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)}
|
||||
/>
|
||||
<Dialog
|
||||
className='settings-toolbar-dialog'
|
||||
style={{
|
||||
backgroundColor: 'var(--vscode-sideBar-background)',
|
||||
padding: '4px 8px'
|
||||
|
|
@ -44,6 +43,7 @@ export const SettingsToolbarButton: React.FC<{}> = () => {
|
|||
verticalOffset={8}
|
||||
requestClose={() => setOpen(false)}
|
||||
anchor={hostingRef}
|
||||
dataTestId='settings-toolbar-dialog'
|
||||
>
|
||||
<DefaultSettingsView />
|
||||
</Dialog>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export interface DialogProps {
|
|||
verticalOffset?: number;
|
||||
requestClose?: () => void;
|
||||
anchor?: React.RefObject<HTMLElement>;
|
||||
dataTestId?: string;
|
||||
}
|
||||
|
||||
export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
|
||||
|
|
@ -34,6 +35,7 @@ export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
|
|||
verticalOffset,
|
||||
requestClose,
|
||||
anchor,
|
||||
dataTestId,
|
||||
children,
|
||||
}) => {
|
||||
const dialogRef = React.useRef<HTMLDialogElement>(null);
|
||||
|
|
@ -96,7 +98,7 @@ export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
|
|||
|
||||
return (
|
||||
open && (
|
||||
<dialog ref={dialogRef} style={style} className={className} open>
|
||||
<dialog ref={dialogRef} style={style} className={className} data-testid={dataTestId} open>
|
||||
{children}
|
||||
</dialog>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class TraceViewerPage {
|
|||
this.metadataTab = page.getByTestId('metadata-view');
|
||||
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.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>`);
|
||||
});
|
||||
|
||||
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
|
||||
await traceViewer.selectAction('goto', 0);
|
||||
|
|
@ -1659,7 +1659,7 @@ test('should toggle canvas rendering', async ({ runAndTrace, page }) => {
|
|||
// Deselect canvas
|
||||
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
|
||||
await traceViewer.selectAction('goto', 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue