Skip to content

Commit

Permalink
Simple tests for correct gene model and sixframe
Browse files Browse the repository at this point in the history
Mostly to experiment with cypress-image-diff
  • Loading branch information
dariober committed Dec 20, 2024
1 parent 45422a9 commit 0009fac
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 15 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions packages/jbrowse-plugin-apollo/cypress/e2e/showWarnings.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
describe('Visual', () => {
beforeEach(() => {
cy.loginAsGuest()
})
afterEach(() => {
cy.deleteAssemblies()
})
it('Show warnings', () => {
cy.addAssemblyFromGff(
'stopcodon.gff3',
'test_data/cdsChecks/stopcodon.gff3',
)
cy.selectAssemblyToView('stopcodon.gff3')
cy.searchFeatures('gene07', 1)

// Here it would be nice to check that there are no ErrorIcons yet.
// For this we need to make sure that the gene model is actually on the canvas,
// which is not obvious how to do.

cy.get('button[data-testid="track_menu_icon"]').click()
cy.contains('Appearance').trigger('mouseover')
cy.contains('Show both graphical and table display').click()
cy.contains('cds07').rightclick()
cy.contains('Edit feature details').click()
cy.contains('Basic information')
.parent()
.within(() => {
cy.get('input[value="16"]').type('{selectall}{backspace}4{enter}')
cy.get('input[value="27"]').type('{selectall}{backspace}24{enter}')
})
cy.get('button[data-testid="zoom_out"]').click()

// FIXME: There should be 2 ErrorIcons not 3
cy.get('[data-testid="ErrorIcon"]', { timeout: 5000 }).should(
'have.length',
3,
)
cy.get('[data-testid="ErrorIcon"]', { timeout: 5000 })
.last()
.trigger('mouseover')
cy.contains(/(internal stop codon)|(missing stop codon)/)

// Fix the missing stop codon. Internal stop still expected
cy.contains('Basic information')
.parent()
.within(() => {
cy.get('input[value="24"]').type('{selectall}{backspace}27{enter}')
})
cy.get('button[data-testid="zoom_out"]').click()
cy.reload()
cy.get('[data-testid="ErrorIcon"]', { timeout: 5000 }).should(
'have.length',
1,
)
})
})
23 changes: 23 additions & 0 deletions packages/jbrowse-plugin-apollo/cypress/e2e/simpleVisual.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('Simple tests for visuals', () => {
beforeEach(() => {
cy.loginAsGuest()
})
afterEach(() => {
cy.deleteAssemblies()
})
it('Shows correct gene model', () => {
cy.addAssemblyFromGff(
'stopcodon.gff3',
'test_data/cdsChecks/stopcodon.gff3',
)
cy.selectAssemblyToView('stopcodon.gff3')
cy.searchFeatures('gene08', 1)
cy.wait(5000) // Wait for the gene model to render. It would be better to ensure some element of the canvas is actually there

cy.get('canvas[data-testid="overlayCanvas"]').compareSnapshot('gene-model')

cy.get('canvas[data-testid="seqTrackOverlayCanvas"]').compareSnapshot(
'sixframe',
)
})
})
15 changes: 0 additions & 15 deletions packages/jbrowse-plugin-apollo/cypress/e2e/test-visual.cy.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/jbrowse-plugin-apollo/cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["es5", "dom"],
"types": ["cypress", "node"],
"strict": true,
"esModuleInterop": true,
},
"include": ["**/*.ts", "../cypress.config.js"],
}
15 changes: 15 additions & 0 deletions packages/jbrowse-plugin-apollo/test_data/cdsChecks/stopcodon.gff3
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ chr4 . CDS 1 30 . - 0 ID=cds04.1;Parent=mrna04
chr6 . gene 1 30 . + . ID=gene06
chr6 . mRNA 1 30 . + . ID=mrna06;Parent=gene06
chr6 . CDS 1 10 . + 0 ID=cds06.1;Parent=mrna06
#
chr7 . gene 4 27 . + . ID=gene07
chr7 . mRNA 4 27 . + . ID=mrna07;Parent=gene07
chr7 . exon 4 27 . + 0 ID=exon07;Parent=mrna07
chr7 . CDS 16 27 . + 0 ID=cds07;Parent=mrna07
#
chr8 . gene 1 32 . + . ID=gene08
chr8 . mRNA 1 32 . + . ID=mrna08;Parent=gene08
chr8 . exon 1 12 . + 0 ID=exon08.1;Parent=mrna08
chr8 . exon 16 32 . + 0 ID=exon08.2;Parent=mrna08
chr8 . CDS 4 27 . + 0 ID=cds08;Parent=mrna08
##FASTA
>chr1
ATGGTGCCGCAAAGTACTGGTGGGGGTTAAnnnnnnnnnnnnnnnnnnnnn
Expand All @@ -35,3 +46,7 @@ TTActaCCCACCAGTACTTTGCGGtcaCATnnnnnnnnnnnnnnnnnnnnn
ATGGTGtagCAAAGTACTGTTAGGGGTTAAnnnnnnnnnnnnnnnnnnnnn
>chr6
ATGGTGtagCAAAGTACTGTTAGGGGTTAAnnnnnnnnnnnnnnnnnnnnn
>chr7
ATGGTGtagCAAAGTATGGTTAGGtagTAAnnnnnnnnnnnnnnnnnnnnn
>chr8
ATGATGTATCAAAGTATGGTTAGGTAGTAACTGCTCAGCAATCTATCTTTA

0 comments on commit 0009fac

Please sign in to comment.