Skip to content

Commit

Permalink
Fix fork test
Browse files Browse the repository at this point in the history
delfrrr committed Apr 10, 2024
1 parent 20ff61f commit c1ffa8c
Showing 2 changed files with 11 additions and 16 deletions.
25 changes: 9 additions & 16 deletions cypress/e2e/snowflake/fork.cy.js
Original file line number Diff line number Diff line change
@@ -29,27 +29,20 @@ describe('fork', () => {
cy.get('textarea').type('select 0 as lat, 0 as lon', { force: true })
cy.get(`button:contains("${copy.execute}")`).click()
cy.get('div:contains("1 rows")', { timeout: 20000 }).should('be.visible')
cy.window().then(async (win) => {
if (!Cypress.env('CI')) {
originalColor = await getColorAtMapCenter(win)
expect(originalColor).to.be.a('string')
}
})

cy.get('span[title="Dataset setting"]').click()
cy.get('input#dekart-dataset-name-input').should('be.visible')
const randomDatasetName = `test-${Math.floor(Math.random() * 1000000)}`
cy.get('input#dekart-dataset-name-input').type(randomDatasetName)
cy.get('button#dekart-save-dataset-name-button').click()
cy.get(`span:contains("${randomDatasetName}")`).should('be.visible')
cy.get('button#dekart-save-button').should('contain', 'Save')
cy.get('button#dekart-save-button').click()
cy.get('button#dekart-save-button').should('not.contain', 'Save*')
cy.get('button#dekart-save-button').should('contain', 'Save')
cy.get('button#dekart-fork-button').click()
cy.get('#dekart-query-status-message').should('be.empty')
cy.get(`button:contains("${copy.execute}")`).should('be.enabled')
cy.get(`button:contains("${copy.execute}")`).click()
cy.get('span:contains("Fork of Untitled")').should('be.visible')
cy.get('div:contains("1 rows")', { timeout: 20000 }).should('be.visible')
cy.window().then(async (win) => {
if (!Cypress.env('CI')) {
const color = await getColorAtMapCenter(win)
expect(color).to.be.a('string')
expect(color).to.equal(originalColor)
}
})
cy.get(`span:contains("${randomDatasetName}")`).should('be.visible')
})
})
2 changes: 2 additions & 0 deletions src/client/DatasetSettingsModal.js
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ function ModalFooter ({ saving, setSaving, name, datasetId }) {
<div className={styles.modalFooter}>
<Button
disabled={saving}
id='dekart-save-dataset-name-button'
onClick={() => {
setSaving(true)
dispatch(updateDatasetName(datasetId, name))
@@ -89,6 +90,7 @@ export default function DatasetSettingsModal () {
value={name}
onChange={(e) => setName(e.target.value)}
disabled={saving}
id='dekart-dataset-name-input'
/>
</div>
</Modal>

0 comments on commit c1ffa8c

Please sign in to comment.