-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from gchq/dev/fix-delete-model
Dev/fix delete model
- Loading branch information
Showing
26 changed files
with
558 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import convertNameToUrlFormat from '../utils/convertNameToUrlFormat' | ||
|
||
let modelUrl = '' | ||
|
||
describe('delete version', () => { | ||
before(() => { | ||
cy.log('Navigate to Upload page and json tab') | ||
cy.visit('/upload') | ||
cy.get('[data-test=uploadJsonTab]').click({ force: true }) | ||
|
||
cy.log('Selecting schema and inputting metadata') | ||
cy.get('[data-test=selectSchemaInput]').trigger('mousedown', { force: true, button: 0 }) | ||
cy.fixture('schema_names.json').then((schemaNames) => { | ||
cy.get(`[role=option]:contains(${schemaNames.model})`).click() | ||
}) | ||
|
||
cy.fixture('minimal_metadata.json').then((modelMetadata) => { | ||
const updatedMetadata = { ...modelMetadata } | ||
updatedMetadata.buildOptions.uploadType = 'Model card only' | ||
cy.get('[data-test=metadataTextarea]') | ||
.clear() | ||
.type(JSON.stringify(updatedMetadata), { parseSpecialCharSequences: false, delay: 0 }) | ||
|
||
cy.log('Submitting model') | ||
cy.get('[data-test=warningCheckbox]').click() | ||
cy.get('[data-test=submitButton]').click() | ||
cy.url({ timeout: 15000 }) | ||
.should('contain', `/model/${convertNameToUrlFormat(updatedMetadata.highLevelDetails.name)}`) | ||
.then((url) => { | ||
modelUrl = url | ||
}) | ||
}) | ||
}) | ||
|
||
it('Can delete a model version and all corresponding data', () => { | ||
cy.visit(`${modelUrl}?tab=settings`) | ||
cy.get('[data-test=modelSettingsPage]').contains('Danger Zone') | ||
cy.log('Select delete version button') | ||
cy.get('[data-test=deleteVersionButton]').click() | ||
cy.log('Select confirm') | ||
cy.get('[data-test=confirmButton]').click() | ||
cy.visit(modelUrl) | ||
cy.get('body').contains('Unable to find model') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.