mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: do not double trim in trace viewer (#12338)
This commit is contained in:
parent
91672595f2
commit
821a8e93c7
@ -68,7 +68,7 @@ export const CallTab: React.FunctionComponent<{
|
||||
|
||||
function renderLine(metadata: CallMetadata, name: string, value: any, key: string) {
|
||||
const { title, type } = toString(metadata, name, value);
|
||||
let text = trimRight(title.replace(/\n/g, '↵'), 80);
|
||||
let text = title.replace(/\n/g, '↵');
|
||||
if (type === 'string')
|
||||
text = `"${text}"`;
|
||||
return <div key={key} className='call-line'>{name}: <span className={type} title={title}>{text}</span></div>;
|
||||
@ -88,9 +88,3 @@ function toString(metadata: CallMetadata, name: string, value: any): { title: st
|
||||
return { title: '<handle>', type: 'handle' };
|
||||
return { title: JSON.stringify(value), type: 'object' };
|
||||
}
|
||||
|
||||
function trimRight(text: string, max: number): string {
|
||||
if (text.length > max)
|
||||
return text.substr(0, max) + '\u2026';
|
||||
return text;
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ test('should show params and return value', async ({ showTraceViewer, browserNam
|
||||
/page.evaluate/,
|
||||
/wall time: [0-9/:,APM ]+/,
|
||||
/duration: [\d]+ms/,
|
||||
'expression: "({↵ a↵ }) => {↵ console.log(\'Info\');↵ console.warn(\'Warning\');↵ con…"',
|
||||
/expression: "\({↵ a↵ }\) => {↵ console\.log\(\'Info\'\);↵ console\.warn\(\'Warning\'\);↵ console/,
|
||||
'isFunction: true',
|
||||
'arg: {"a":"paramA","b":4}',
|
||||
'value: "return paramA"'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user