Clean up new tests
This commit is contained in:
parent
9f05f03fc9
commit
58452b434f
|
|
@ -33,7 +33,6 @@ export const SettingsToolbarButton: React.FC<{}> = () => {
|
||||||
onClick={() => setOpen(current => !current)}
|
onClick={() => setOpen(current => !current)}
|
||||||
/>
|
/>
|
||||||
<Dialog
|
<Dialog
|
||||||
className='settings-toolbar-dialog'
|
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: 'var(--vscode-sideBar-background)',
|
backgroundColor: 'var(--vscode-sideBar-background)',
|
||||||
padding: '4px 8px'
|
padding: '4px 8px'
|
||||||
|
|
@ -44,6 +43,7 @@ export const SettingsToolbarButton: React.FC<{}> = () => {
|
||||||
verticalOffset={8}
|
verticalOffset={8}
|
||||||
requestClose={() => setOpen(false)}
|
requestClose={() => setOpen(false)}
|
||||||
anchor={hostingRef}
|
anchor={hostingRef}
|
||||||
|
dataTestId='settings-toolbar-dialog'
|
||||||
>
|
>
|
||||||
<DefaultSettingsView />
|
<DefaultSettingsView />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ export interface DialogProps {
|
||||||
verticalOffset?: number;
|
verticalOffset?: number;
|
||||||
requestClose?: () => void;
|
requestClose?: () => void;
|
||||||
anchor?: React.RefObject<HTMLElement>;
|
anchor?: React.RefObject<HTMLElement>;
|
||||||
|
dataTestId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
|
export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
|
||||||
|
|
@ -34,6 +35,7 @@ export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
|
||||||
verticalOffset,
|
verticalOffset,
|
||||||
requestClose,
|
requestClose,
|
||||||
anchor,
|
anchor,
|
||||||
|
dataTestId,
|
||||||
children,
|
children,
|
||||||
}) => {
|
}) => {
|
||||||
const dialogRef = React.useRef<HTMLDialogElement>(null);
|
const dialogRef = React.useRef<HTMLDialogElement>(null);
|
||||||
|
|
@ -96,7 +98,7 @@ export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
open && (
|
open && (
|
||||||
<dialog ref={dialogRef} style={style} className={className} open>
|
<dialog ref={dialogRef} style={style} className={className} data-testid={dataTestId} open>
|
||||||
{children}
|
{children}
|
||||||
</dialog>
|
</dialog>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class TraceViewerPage {
|
||||||
this.metadataTab = page.getByTestId('metadata-view');
|
this.metadataTab = page.getByTestId('metadata-view');
|
||||||
this.sourceCodeTab = page.getByTestId('source-code');
|
this.sourceCodeTab = page.getByTestId('source-code');
|
||||||
|
|
||||||
this.settingsDialog = page.locator('.settings-toolbar-dialog');
|
this.settingsDialog = page.getByTestId('settings-toolbar-dialog');
|
||||||
this.darkModeSetting = page.locator('.setting').getByText('Dark mode');
|
this.darkModeSetting = page.locator('.setting').getByText('Dark mode');
|
||||||
this.displayCanvasContentSetting = page.locator('.setting').getByText('Display canvas content');
|
this.displayCanvasContentSetting = page.locator('.setting').getByText('Display canvas content');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1641,7 +1641,7 @@ test('should toggle canvas rendering', async ({ runAndTrace, page }) => {
|
||||||
await page.goto(`data:text/html,<!DOCTYPE html><body><div>Hello world</div></body>`);
|
await page.goto(`data:text/html,<!DOCTYPE html><body><div>Hello world</div></body>`);
|
||||||
});
|
});
|
||||||
|
|
||||||
let snapshotRequestPromise = traceViewer.page.waitForRequest(request => request.url().includes('/snapshot/'), { timeout: 2000 });
|
let snapshotRequestPromise = traceViewer.page.waitForRequest(request => request.url().includes('/snapshot/'));
|
||||||
|
|
||||||
// Click on the action with a canvas snapshot
|
// Click on the action with a canvas snapshot
|
||||||
await traceViewer.selectAction('goto', 0);
|
await traceViewer.selectAction('goto', 0);
|
||||||
|
|
@ -1659,7 +1659,7 @@ test('should toggle canvas rendering', async ({ runAndTrace, page }) => {
|
||||||
// Deselect canvas
|
// Deselect canvas
|
||||||
await traceViewer.selectAction('goto', 1);
|
await traceViewer.selectAction('goto', 1);
|
||||||
|
|
||||||
snapshotRequestPromise = traceViewer.page.waitForRequest(request => request.url().includes('/snapshot/'), { timeout: 2000 });
|
snapshotRequestPromise = traceViewer.page.waitForRequest(request => request.url().includes('/snapshot/'));
|
||||||
|
|
||||||
// Select canvas again
|
// Select canvas again
|
||||||
await traceViewer.selectAction('goto', 0);
|
await traceViewer.selectAction('goto', 0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue