mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
This commit is contained in:
parent
8324c851e9
commit
f32d32676d
2 changed files with 16 additions and 8 deletions
|
@ -82,4 +82,19 @@ describe('ExecutedStep', () => {
|
|||
expect(getByText('Console output'));
|
||||
expect(getByText(browserConsole[0]));
|
||||
});
|
||||
|
||||
it('renders multi-line console output', () => {
|
||||
const browserConsole = ['line1', 'line2', 'line3'];
|
||||
|
||||
const { getByText } = render(
|
||||
<ExecutedStep browserConsoles={browserConsole} index={3} step={step} loading={false} />
|
||||
);
|
||||
|
||||
expect(getByText('Console output'));
|
||||
|
||||
const codeBlock = getByText('line1 line2', { exact: false });
|
||||
expect(codeBlock.innerHTML).toEqual(`line1
|
||||
line2
|
||||
line3`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -88,14 +88,7 @@ export const ExecutedStep: FC<ExecutedStepProps> = ({ loading, step, index, brow
|
|||
language="javascript"
|
||||
initialIsOpen={!isSucceeded}
|
||||
>
|
||||
<>
|
||||
{browserConsoles?.map((browserConsole) => (
|
||||
<>
|
||||
{browserConsole}
|
||||
<EuiSpacer />
|
||||
</>
|
||||
))}
|
||||
</>
|
||||
{browserConsoles?.join('\n')}
|
||||
</CodeBlockAccordion>
|
||||
<EuiSpacer />
|
||||
<StepScreenshots step={step} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue