Skip to content

Commit

Permalink
E2E Tests: UI Switch - Combine two tests for better performance
Browse files Browse the repository at this point in the history
  • Loading branch information
joepavitt committed Jan 12, 2024
1 parent 7b85e7a commit 6588906
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cypress/tests/widgets/switch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ describe('Node-RED Dashboard 2.0 - Switches', () => {
cy.get('#nrdb-ui-widget-dashboard-ui-switch-bool').find('.v-input.v-input--horizontal').should('not.have.class', 'active')
})

it('can be set to the on state via incoming payload', () => {
it('can be set to the on state via incoming payload & passes the value through', () => {
cy.get('#nrdb-ui-widget-dashboard-ui-button-bool-on').click()
// Emitting strings
cy.get('#nrdb-ui-widget-dashboard-ui-switch-bool').find('.v-input.v-input--horizontal').should('have.class', 'v-switch')
cy.get('#nrdb-ui-widget-dashboard-ui-switch-bool').find('.v-input.v-input--horizontal').should('have.class', 'active')
})

it('does pass on a value is passthru is set to true', () => {
cy.resetContext()
cy.get('#nrdb-ui-widget-dashboard-ui-button-bool-on').click()
// check passthruy worked
cy.checkOutput('msg.payload', 'on')
})

Expand Down

0 comments on commit 6588906

Please sign in to comment.