Skip to content

Commit

Permalink
fix: add tests for file picker screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
xandervedder committed Nov 16, 2024
1 parent f20a378 commit 551d508
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/elements/src/components/file/file.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class FileComponent extends RealTimeElement {
@state()
public declare filters: StateFilter<MutantStatus>[];

@property()
@property({ attribute: false})
public declare model: FileUnderTestModel;

@state()
Expand Down
4 changes: 4 additions & 0 deletions packages/elements/test/integration/po/ReportPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,8 @@ export class ReportPage extends ElementSelector {
pageYOffset(): Promise<number> {
return this.page.evaluate('window.pageYOffset');
}

async openPicker(): Promise<void> {
await this.page.keyboard.press("Control+K")
}
}
14 changes: 14 additions & 0 deletions packages/elements/test/integration/theming.it.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ test.describe('Theming', () => {

itShouldMatchScreenshot('should match the dark theme');
});

test.describe('when opening the file picker', () => {
test('should show the file picker', async () => {
await page.openPicker();
itShouldMatchScreenshot('should match the dark theme');
});
});
});

test.describe('light theme', () => {
Expand All @@ -67,5 +74,12 @@ test.describe('Theming', () => {

itShouldMatchScreenshot('should match the light theme');
});

test.describe('when opening the file picker', () => {
test('should match screenshot', async () => {
await page.openPicker();
itShouldMatchScreenshot('should match the light theme');
});
});
});
});

0 comments on commit 551d508

Please sign in to comment.