Skip to content

Commit 942b6f3

Browse files
test: migrate chromatic tests (#1745)
* carry over tests * browse datasets tests * download dialog tests * fix not defined error * fix chromatic imports * fix unexpected test.beforeEach() * file format param * fix select copy button * metadata drawer e2e test * pagination e2e test * single dataset filters e2e tests * single run e2e test * single run filters e2e test * wait for table load after selecting / deselecting * more chromatic imports * fix snapshot for carry over tests * fix type error * remove commented out code * re-add styles.boolenWrapped * update title * address feedback * update e2e empiar id value * fix ground truth filter * fix skeleton loader * add snapshot delay for metadata drawer
1 parent 54df0cb commit 942b6f3

26 files changed

+4165
-6301
lines changed

frontend/packages/data-portal/_templates/e2e/new/pageObject.cjs.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
to: e2e/pageObjects/<%= name %>/<%= name %>Page.ts
33
---
4-
import { expect } from '@playwright/test'
4+
import { expect } from '@chromatic-com/playwright'
55
import { BasePage } from 'e2e/pageObjects/basePage'
66

77
export class <%= h.changeCase.pascal(name) %>Page extends BasePage {

frontend/packages/data-portal/_templates/e2e/new/testFile.cjs.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
to: e2e/<%= name %>.test.ts
33
---
44
import { ApolloClient, NormalizedCacheObject } from '@apollo/client'
5-
import { test } from '@playwright/test'
5+
import { test } from '@chromatic-com/playwright'
66
import { <%= h.changeCase.pascal(name) %>Page } from 'e2e/pageObjects/<%= name %>/<%= name %>Page'
77

88
test.describe('<%= name %>', () => {

frontend/packages/data-portal/app/graphql/getDatasetsV2.server.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ export async function getDatasetsV2({
7373
page,
7474
titleOrderDirection,
7575
searchText,
76-
params,
76+
params = new URLSearchParams(),
7777
client,
7878
}: {
7979
page: number
8080
titleOrderDirection?: OrderBy
8181
searchText?: string
82-
params: URLSearchParams
82+
params?: URLSearchParams
8383
client: ApolloClient<NormalizedCacheObject>
8484
}): Promise<ApolloQueryResult<GetDatasetsV2Query>> {
8585
return client.query({

frontend/packages/data-portal/app/graphql/getRunByIdV2.server.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -555,15 +555,15 @@ export interface GetRunByIdV2Params {
555555
client: ApolloClient<NormalizedCacheObject>
556556
id: number
557557
annotationsPage: number
558-
params: URLSearchParams
558+
params?: URLSearchParams
559559
depositionId?: number
560560
}
561561

562562
export async function getRunByIdV2({
563563
client,
564564
id,
565565
annotationsPage,
566-
params,
566+
params = new URLSearchParams(),
567567
depositionId,
568568
}: GetRunByIdV2Params): Promise<ApolloQueryResult<GetRunByIdV2Query>> {
569569
return client.query({

0 commit comments

Comments
 (0)