Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions hooks/useBRIGController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,7 @@ export function useBRIGController() {
params,
imageProperties,
referenceAnnotations,
plotData ? {
...plotData,
reference: {
...plotData.reference,
gcContent: params.showGCContent !== false ? plotData.reference.gcContent : undefined,
gcSkew: params.showGCSkew !== false ? plotData.reference.gcSkew : undefined,
},
} : null,
plotData,
);
const blob = new Blob([json], { type: 'application/json' });
const url = URL.createObjectURL(blob);
Expand Down
21 changes: 21 additions & 0 deletions tests/e2e/brigx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,27 @@ test.describe('BRIGX e2e — circular genome plot', () => {
const svg = await fs.readFile(downloadedPath!, 'utf8')
expect(svg).not.toContain('id="gc-content-ring"')
expect(svg).toContain('id="gc-skew-ring"')

const sessionDownloadPromise = page.waitForEvent('download')
await page.getByRole('button', { name: 'Save session' }).click()
const sessionDownload = await sessionDownloadPromise
const sessionPath = await sessionDownload.path()
expect(sessionPath).not.toBeNull()
const session = JSON.parse(await fs.readFile(sessionPath!, 'utf8'))
expect(session.params.showGCContent).toBe(false)
expect(session.result.plot.reference.gcContent.length).toBeGreaterThan(0)

await page.getByLabel('Load session').setInputFiles(sessionPath!)
await expect(page.getByText('Session and saved result loaded.')).toBeVisible()
await expect(page.getByLabel('GC Content')).not.toBeChecked()
await page.getByLabel('GC Content').check()

const restoredDownloadPromise = page.waitForEvent('download')
await page.getByRole('button', { name: 'SVG', exact: true }).click()
const restoredDownload = await restoredDownloadPromise
const restoredPath = await restoredDownload.path()
expect(restoredPath).not.toBeNull()
expect(await fs.readFile(restoredPath!, 'utf8')).toContain('id="gc-content-ring"')
})

test('PNG export matches the live canvas after moving a legend', async ({ page }) => {
Expand Down