Skip to content

Commit

Permalink
chore: cypress lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
turban committed Jun 27, 2023
1 parent ddb2d82 commit 68bd17d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 deletions.
2 changes: 2 additions & 0 deletions cypress/elements/basemap_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const activeBasemap = (basemapName) => {
cy.getByDataTest('basemaplistitem-name')
.contains(basemapName)
.scrollIntoView()

cy.getByDataTest('basemaplistitem-name')
.siblings('[data-test=basemaplistitem-img]')
.should('have.css', 'outline', 'rgb(21, 101, 192) solid 3px') // TODO - could remove the actual attribute value
}
Expand Down
13 changes: 11 additions & 2 deletions cypress/elements/file_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ export const openMap = (mapName) => {
method: 'GET',
url: /\/maps\?/,
}).as('fetchListOfMaps')

cy.getByDataTest('open-file-dialog-modal-name-filter').find('input').clear()

cy.getByDataTest('open-file-dialog-modal-name-filter').find('input').focus()

cy.getByDataTest('open-file-dialog-modal-name-filter')
.find('input')
.clear()
.focus()
.type(mapName)

cy.wait('@fetchListOfMaps')
Expand Down Expand Up @@ -42,6 +45,9 @@ export const saveAsNewMap = (newMapName) => {
cy.getByDataTest('file-menu-saveas-modal-name-content', EXTENDED_TIMEOUT)
.find('input')
.clear()

cy.getByDataTest('file-menu-saveas-modal-name-content', EXTENDED_TIMEOUT)
.find('input')
.type(newMapName)

cy.get('button').contains('Save').click()
Expand All @@ -58,6 +64,9 @@ export const saveNewMap = (newMapName) => {
cy.getByDataTest('file-menu-saveas-modal-name-content', EXTENDED_TIMEOUT)
.find('input')
.clear()

cy.getByDataTest('file-menu-saveas-modal-name-content', EXTENDED_TIMEOUT)
.find('input')
.type(newMapName)

cy.get('button').contains('Save').click()
Expand Down
7 changes: 3 additions & 4 deletions cypress/elements/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ export class Layer {
}

selectOu(ouName) {
cy.getByDataTest('org-unit-tree')
.contains(ouName)
.scrollIntoView()
.click()
cy.getByDataTest('org-unit-tree').contains(ouName).scrollIntoView()

cy.getByDataTest('org-unit-tree').contains(ouName).click()

return this
}
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/layers/facilitylayer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ context('Facility Layers', () => {

Layer.validateDialogClosed(false)

cy.contains('No organisation units are selected')
.scrollIntoView()
.should('be.visible')
cy.contains('No organisation units are selected').scrollIntoView()

cy.contains('No organisation units are selected').should('be.visible')
})

it('adds a facilities layer', () => {
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/layers/orgunitlayer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ context('Org Unit Layers', () => {

Layer.validateDialogClosed(false)

cy.contains('No organisation units are selected')
.scrollIntoView()
.should('be.visible')
cy.contains('No organisation units are selected').scrollIntoView()

cy.contains('No organisation units are selected').should('be.visible')
})

it('adds a org unit layer', () => {
Expand Down
24 changes: 16 additions & 8 deletions cypress/integration/plugin.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}aVYDp6FYyFU`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('aVYDp6FYyFU')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('aVYDp6FYyFU')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap1')

Expand All @@ -48,7 +49,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}zDP78aJU8nX`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('zDP78aJU8nX')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('zDP78aJU8nX')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap')

Expand All @@ -73,7 +75,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}qTfO4YkQ9xW`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('qTfO4YkQ9xW')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('qTfO4YkQ9xW')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap')

Expand Down Expand Up @@ -106,7 +109,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}ZugJzZ7xxRW`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('ZugJzZ7xxRW')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('ZugJzZ7xxRW')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap')

Expand Down Expand Up @@ -139,7 +143,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}ZBjCfSaLSqD`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('ZBjCfSaLSqD')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('ZBjCfSaLSqD')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap')

Expand Down Expand Up @@ -172,7 +177,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}wIIoj44X77r`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('wIIoj44X77r')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('wIIoj44X77r')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap')

Expand All @@ -196,7 +202,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}voX07ulo2Bq`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('voX07ulo2Bq')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('voX07ulo2Bq')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap')

Expand All @@ -220,7 +227,8 @@ describe.skip('Basemap checks for plugin', () => {

// cy.visit(`${pluginUrl}voX07ulo2Bq`, EXTENDED_TIMEOUT);
cy.visit(pluginUrl)
cy.get('#inputMapID').clear().type('voX07ulo2Bq')
cy.get('#inputMapID').clear()
cy.get('#inputMapID').type('voX07ulo2Bq')
cy.get('#btnLoadPlugin').click()
cy.wait('@openMap')

Expand Down

0 comments on commit 68bd17d

Please sign in to comment.