diff --git a/cypress/e2e/console/admin-panel/packet-broker/default-gateway-visibility.spec.js b/cypress/e2e/console/admin-panel/packet-broker/default-gateway-visibility.spec.js index c2c2e7bf74..119e1f4996 100644 --- a/cypress/e2e/console/admin-panel/packet-broker/default-gateway-visibility.spec.js +++ b/cypress/e2e/console/admin-panel/packet-broker/default-gateway-visibility.spec.js @@ -43,7 +43,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save default gateway visibility' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('Default gateway visibility set') .should('be.visible') cy.get('@putCall').should('have.property', 'state', 'Complete') @@ -67,7 +67,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save default gateway visibility' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('Default gateway visibility set') .should('be.visible') cy.get('@putCall').should('have.property', 'state', 'Complete') diff --git a/cypress/e2e/console/admin-panel/packet-broker/routing-policies.spec.js b/cypress/e2e/console/admin-panel/packet-broker/routing-policies.spec.js index d85a82f15d..9be1585b6c 100644 --- a/cypress/e2e/console/admin-panel/packet-broker/routing-policies.spec.js +++ b/cypress/e2e/console/admin-panel/packet-broker/routing-policies.spec.js @@ -47,7 +47,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save routing configuration' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Default routing configuration set') .should('be.visible') @@ -71,7 +71,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save routing configuration' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Default routing configuration set') .should('be.visible') @@ -110,7 +110,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save routing configuration' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Default routing configuration set') .should('be.visible') @@ -133,7 +133,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save routing configuration' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Default routing configuration set') .should('be.visible') @@ -180,7 +180,7 @@ describe('Packet Broker routing policies', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Routing policy set') .should('be.visible') @@ -208,7 +208,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save routing policy' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Routing policy set') .should('be.visible') @@ -235,7 +235,7 @@ describe('Packet Broker routing policies', () => { cy.findByRole('button', { name: 'Save routing policy' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Routing policy set') .should('be.visible') diff --git a/cypress/e2e/console/applications/edit.spec.js b/cypress/e2e/console/applications/edit.spec.js index 70cb7c6e71..bec6cbc5ee 100644 --- a/cypress/e2e/console/applications/edit.spec.js +++ b/cypress/e2e/console/applications/edit.spec.js @@ -52,7 +52,7 @@ describe('Application general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Application updated`) .should('be.visible') @@ -71,7 +71,7 @@ describe('Application general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Application updated`) .should('be.visible') @@ -85,7 +85,9 @@ describe('Application general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`Application updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`Application updated`) + .should('be.visible') }) it('fails adding non-collaborator contact information', () => { @@ -117,7 +119,9 @@ describe('Application general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`Application updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`Application updated`) + .should('be.visible') }) it('succeeds setting current user as contact', () => { diff --git a/cypress/e2e/console/devices/device-overview.spec.js b/cypress/e2e/console/devices/device-overview.spec.js index 98089f305b..15ad0c3579 100644 --- a/cypress/e2e/console/devices/device-overview.spec.js +++ b/cypress/e2e/console/devices/device-overview.spec.js @@ -76,10 +76,10 @@ describe('Device overview', () => { cy.findByRole('button', { name: /Download MAC data/ }).click() }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').should('not.exist') + cy.findByTestId('toast-notification-success').should('not.exist') }) - it('succeeds showing warning when there is no MAC state', () => { + it('succeeds showing error when there is no MAC state', () => { const response = { ids: { device_id: endDeviceId, @@ -107,7 +107,7 @@ describe('Device overview', () => { cy.findByText('Download MAC data', { selector: 'h1' }).should('be.visible') cy.findByRole('button', { name: /Download MAC data/ }).click() }) - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-error') .findByText(`There was an error and MAC state could not be included in the MAC data`) .should('be.visible') }) diff --git a/cypress/e2e/console/devices/edit.spec.js b/cypress/e2e/console/devices/edit.spec.js index 7944a4d476..98a64cfe57 100644 --- a/cypress/e2e/console/devices/edit.spec.js +++ b/cypress/e2e/console/devices/edit.spec.js @@ -113,7 +113,9 @@ describe('Device general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`End device updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`End device updated`) + .should('be.visible') }) it('succeeds editing Network layer', () => { @@ -136,7 +138,9 @@ describe('Device general settings', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`End device updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`End device updated`) + .should('be.visible') }) it('succeeds editing Application layer', () => { @@ -153,7 +157,7 @@ describe('Device general settings', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`End device updated`) .should('be.visible') @@ -177,7 +181,9 @@ describe('Device general settings', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`End device updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`End device updated`) + .should('be.visible') }) it('succeeds editing server adresses', () => { @@ -187,7 +193,9 @@ describe('Device general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`End device updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`End device updated`) + .should('be.visible') }) it('succeeds adding end device attributes', () => { @@ -201,7 +209,9 @@ describe('Device general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`End device updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`End device updated`) + .should('be.visible') }) it('succeeds deleting end device', () => { diff --git a/cypress/e2e/console/devices/messaging/edit.spec.js b/cypress/e2e/console/devices/messaging/edit.spec.js index 7f198a1bcf..17776a65bf 100644 --- a/cypress/e2e/console/devices/messaging/edit.spec.js +++ b/cypress/e2e/console/devices/messaging/edit.spec.js @@ -55,7 +55,9 @@ describe('End device messaging', () => { cy.findAllByRole('button', { name: 'Simulate uplink' }).filter('[type="submit"]').click() - cy.findByTestId('toast-notification').should('be.visible').and('contain', 'Uplink sent') + cy.findByTestId('toast-notification-success') + .should('be.visible') + .and('contain', 'Uplink sent') cy.findByTestId('error-notification').should('not.exist') }) diff --git a/cypress/e2e/console/devices/onboarding/claiming.spec.js b/cypress/e2e/console/devices/onboarding/claiming.spec.js index 91f4f1ad9b..2c46cee3e8 100644 --- a/cypress/e2e/console/devices/onboarding/claiming.spec.js +++ b/cypress/e2e/console/devices/onboarding/claiming.spec.js @@ -92,7 +92,9 @@ describe('End device repository claiming', () => { cy.wait('@claim-request') .its('request.body') .should('deep.equal', composeExpectedRequest(device1)) - cy.findByTestId('toast-notification').findByText('End device registered').should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText('End device registered') + .should('be.visible') cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') cy.intercept('POST', '/api/v3/edcs/claim', composeClaimResponse(device2)).as('claim-request') @@ -184,7 +186,9 @@ describe('End device repository claiming', () => { .its('request.body') .should('deep.equal', composeExpectedRequest(device1)) // Properly wait for the form to finish submitting. - cy.findByTestId('toast-notification').findByText('End device registered').should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText('End device registered') + .should('be.visible') cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') cy.intercept('POST', '/api/v3/edcs/claim', composeClaimResponse(device2)).as('claim-request') @@ -200,7 +204,9 @@ describe('End device repository claiming', () => { .its('request.body') .should('deep.equal', composeExpectedRequest(device2)) // Properly wait for the form to finish submitting. - cy.findByTestId('toast-notification').findByText('End device registered').should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText('End device registered') + .should('be.visible') cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') cy.intercept('POST', '/api/v3/edcs/claim', composeClaimResponse(device3)).as('claim-request') diff --git a/cypress/e2e/console/devices/onboarding/manual-registration.spec.js b/cypress/e2e/console/devices/onboarding/manual-registration.spec.js index 722bcacfdc..a6200dac97 100644 --- a/cypress/e2e/console/devices/onboarding/manual-registration.spec.js +++ b/cypress/e2e/console/devices/onboarding/manual-registration.spec.js @@ -760,7 +760,7 @@ describe('End device manual create', () => { cy.findByRole('button', { name: 'Register end device' }).click() - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('End device registered') .should('be.visible') cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') @@ -772,7 +772,7 @@ describe('End device manual create', () => { cy.findByRole('button', { name: 'Register end device' }).click() - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('End device registered') .should('be.visible') cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') diff --git a/cypress/e2e/console/devices/onboarding/repository-registration.spec.js b/cypress/e2e/console/devices/onboarding/repository-registration.spec.js index 6c42a45520..9bebaff28b 100644 --- a/cypress/e2e/console/devices/onboarding/repository-registration.spec.js +++ b/cypress/e2e/console/devices/onboarding/repository-registration.spec.js @@ -361,7 +361,7 @@ describe('End device repository manual registration', () => { cy.findByRole('button', { name: 'Register end device' }).click() cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('End device registered') .should('be.visible') @@ -506,7 +506,7 @@ describe('End device repository manual registration', () => { cy.findByLabelText('Register another end device of this type').check() cy.findByRole('button', { name: 'Register end device' }).click() - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('End device registered') .should('be.visible') cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') @@ -521,7 +521,7 @@ describe('End device repository manual registration', () => { cy.findByLabelText('Register another end device of this type').check() cy.findByRole('button', { name: 'Register end device' }).click() - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('End device registered') .should('be.visible') cy.findByRole('button', { name: 'Register end device' }).should('not.be.disabled') diff --git a/cypress/e2e/console/gateways/edit.spec.js b/cypress/e2e/console/gateways/edit.spec.js index 0266567679..e740ba249f 100644 --- a/cypress/e2e/console/gateways/edit.spec.js +++ b/cypress/e2e/console/gateways/edit.spec.js @@ -184,7 +184,7 @@ describe('Gateway general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText('Gateway updated').should('be.visible') + cy.findByTestId('toast-notification-success').findByText('Gateway updated').should('be.visible') cy.reload() cy.findByLabelText('Gateway name').should('have.value', newGatewayName) @@ -219,7 +219,7 @@ describe('Gateway general settings', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText('Gateway updated').should('be.visible') + cy.findByTestId('toast-notification-success').findByText('Gateway updated').should('be.visible') cy.reload() cy.findByText('LoRaWAN options', { selector: 'h3' }) @@ -266,7 +266,7 @@ describe('Gateway general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`Gateway updated`).should('be.visible') + cy.findByTestId('toast-notification-success').findByText(`Gateway updated`).should('be.visible') }) it('succeeds setting current user as contact', () => { @@ -317,7 +317,7 @@ describe('Gateway general settings', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText('Gateway updated').should('be.visible') + cy.findByTestId('toast-notification-success').findByText('Gateway updated').should('be.visible') cy.reload() cy.findByText('LoRaWAN options', { selector: 'h3' }) diff --git a/cypress/e2e/console/gateways/location/create.spec.js b/cypress/e2e/console/gateways/location/create.spec.js index a5ab77e6e7..0d97de0a53 100644 --- a/cypress/e2e/console/gateways/location/create.spec.js +++ b/cypress/e2e/console/gateways/location/create.spec.js @@ -113,7 +113,7 @@ describe('Gateway location create', () => { cy.findByRole('button', { name: 'Save changes' }).click() - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Location updated`) .should('be.visible') diff --git a/cypress/e2e/console/gateways/location/edit.spec.js b/cypress/e2e/console/gateways/location/edit.spec.js index 7614484d32..6a6bdc58ce 100644 --- a/cypress/e2e/console/gateways/location/edit.spec.js +++ b/cypress/e2e/console/gateways/location/edit.spec.js @@ -78,7 +78,7 @@ describe('Gateway location', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Location updated`) .should('be.visible') @@ -94,7 +94,7 @@ describe('Gateway location', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Location updated`) .should('be.visible') @@ -113,7 +113,7 @@ describe('Gateway location', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Location updated`) .should('be.visible') @@ -132,7 +132,7 @@ describe('Gateway location', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Location deleted`) .should('be.visible') diff --git a/cypress/e2e/console/gateways/managed/connection-settings.spec.js b/cypress/e2e/console/gateways/managed/connection-settings.spec.js index 4c05ee9a40..7639a19cd6 100644 --- a/cypress/e2e/console/gateways/managed/connection-settings.spec.js +++ b/cypress/e2e/console/gateways/managed/connection-settings.spec.js @@ -171,7 +171,7 @@ describe('Managed Gateway connection settings', () => { 'be.visible', ) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'Connection settings updated') }) @@ -211,7 +211,7 @@ describe('Managed Gateway connection settings', () => { 'be.visible', ) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'Connection settings updated') }) @@ -233,7 +233,7 @@ describe('Managed Gateway connection settings', () => { 'be.visible', ) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'Connection settings updated') }) @@ -246,7 +246,7 @@ describe('Managed Gateway connection settings', () => { expect(body).to.have.nested.property('gateway.ethernet_profile_id', ethernetProfileId) }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'Connection settings updated') }) @@ -281,7 +281,7 @@ describe('Managed Gateway connection settings', () => { expect(body).to.have.nested.property('gateway.ethernet_profile_id', ethernetProfileId) }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'Connection settings updated') }) @@ -316,7 +316,7 @@ describe('Managed Gateway connection settings', () => { 'be.visible', ) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'Connection settings updated') }) diff --git a/cypress/e2e/console/gateways/managed/wifi-profiles.spec.js b/cypress/e2e/console/gateways/managed/wifi-profiles.spec.js index 873a7ce0c4..182a08d03e 100644 --- a/cypress/e2e/console/gateways/managed/wifi-profiles.spec.js +++ b/cypress/e2e/console/gateways/managed/wifi-profiles.spec.js @@ -196,7 +196,7 @@ describe('Managed Gateway WiFi profiles', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.wait('@create-profile').its('request.body').should('deep.equal', expectedRequest) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'WiFi profile created') cy.location('pathname').should( @@ -221,7 +221,7 @@ describe('Managed Gateway WiFi profiles', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.wait('@create-profile').its('request.body').should('deep.equal', expectedRequest) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'WiFi profile created') cy.location('pathname').should( @@ -245,7 +245,7 @@ describe('Managed Gateway WiFi profiles', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.wait('@create-profile').its('request.body').should('deep.equal', expectedRequest) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'WiFi profile created') cy.location('pathname').should( @@ -288,7 +288,7 @@ describe('Managed Gateway WiFi profiles', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.wait('@create-profile').its('request.body').should('deep.equal', expectedRequest) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'WiFi profile created') cy.location('pathname').should( @@ -348,7 +348,7 @@ describe('Managed Gateway WiFi profiles', () => { expect(body.profile).to.deep.equal(expectedRequest) }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'WiFi profile updated') }) @@ -376,7 +376,7 @@ describe('Managed Gateway WiFi profiles', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .and('contain', 'WiFi profile deleted') cy.findByRole('rowgroup').within(() => { diff --git a/cypress/e2e/console/integrations/pub-subs/edit.spec.js b/cypress/e2e/console/integrations/pub-subs/edit.spec.js index dae2f2ca9a..1eef04875c 100644 --- a/cypress/e2e/console/integrations/pub-subs/edit.spec.js +++ b/cypress/e2e/console/integrations/pub-subs/edit.spec.js @@ -111,7 +111,7 @@ describe('Application Pub/Sub', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Pub/Sub updated`) .should('be.visible') diff --git a/cypress/e2e/console/integrations/webhooks/edit.spec.js b/cypress/e2e/console/integrations/webhooks/edit.spec.js index 049b46147e..ee203d919a 100644 --- a/cypress/e2e/console/integrations/webhooks/edit.spec.js +++ b/cypress/e2e/console/integrations/webhooks/edit.spec.js @@ -76,7 +76,7 @@ describe('Application Webhook', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText('Webhook updated').should('be.visible') + cy.findByTestId('toast-notification-success').findByText('Webhook updated').should('be.visible') cy.reload() cy.findByLabelText('Base URL').should('have.attr', 'value', webhook.url) @@ -90,7 +90,7 @@ describe('Application Webhook', () => { cy.findByLabelText('Join accept').should('not.be.checked') cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`Webhook updated`).should('be.visible') + cy.findByTestId('toast-notification-success').findByText(`Webhook updated`).should('be.visible') cy.reload() cy.findByLabelText('Base URL').should('have.attr', 'value', webhook.url) @@ -103,7 +103,7 @@ describe('Application Webhook', () => { cy.findByLabelText('Uplink message').uncheck() cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`Webhook updated`).should('be.visible') + cy.findByTestId('toast-notification-success').findByText(`Webhook updated`).should('be.visible') cy.reload() cy.findByLabelText('Uplink message').should('not.be.checked') @@ -125,7 +125,7 @@ describe('Application Webhook', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Webhook updated`) .should('be.visible') @@ -162,7 +162,7 @@ describe('Application Webhook', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Webhook updated`) .should('be.visible') diff --git a/cypress/e2e/console/organizations/edit.spec.js b/cypress/e2e/console/organizations/edit.spec.js index d32a4cc481..bb0c55e176 100644 --- a/cypress/e2e/console/organizations/edit.spec.js +++ b/cypress/e2e/console/organizations/edit.spec.js @@ -53,7 +53,7 @@ describe('Organization general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Organization updated`) .should('be.visible') @@ -86,7 +86,9 @@ describe('Organization general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').findByText(`Organization updated`).should('be.visible') + cy.findByTestId('toast-notification-success') + .findByText(`Organization updated`) + .should('be.visible') }) it('succeeds setting current user as contact', () => { diff --git a/cypress/e2e/console/shared/api-keys/edit.spec.js b/cypress/e2e/console/shared/api-keys/edit.spec.js index f424cc0983..6d306820e8 100644 --- a/cypress/e2e/console/shared/api-keys/edit.spec.js +++ b/cypress/e2e/console/shared/api-keys/edit.spec.js @@ -62,7 +62,7 @@ describe('API keys', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`API key updated`) .should('be.visible') @@ -131,7 +131,7 @@ describe('API keys', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`API key updated`) .should('be.visible') @@ -202,7 +202,7 @@ describe('API keys', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`API key updated`) .should('be.visible') @@ -266,7 +266,7 @@ describe('API keys', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`API key updated`) .should('be.visible') diff --git a/cypress/e2e/console/shared/collaborators/edit.spec.js b/cypress/e2e/console/shared/collaborators/edit.spec.js index 58e17b24ac..955c1632e4 100644 --- a/cypress/e2e/console/shared/collaborators/edit.spec.js +++ b/cypress/e2e/console/shared/collaborators/edit.spec.js @@ -101,7 +101,7 @@ describe('Collaborators', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Collaborator rights updated`) .should('be.visible') @@ -146,7 +146,7 @@ describe('Collaborators', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Collaborator rights updated`) .should('be.visible') @@ -205,7 +205,7 @@ describe('Collaborators', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Collaborator rights updated`) .should('be.visible') @@ -250,7 +250,7 @@ describe('Collaborators', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Collaborator rights updated`) .should('be.visible') @@ -303,7 +303,7 @@ describe('Collaborators', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`Member rights updated`) .should('be.visible') diff --git a/cypress/e2e/console/shared/payload-formatters/edit.spec.js b/cypress/e2e/console/shared/payload-formatters/edit.spec.js index 4738a0f574..25efd5f718 100644 --- a/cypress/e2e/console/shared/payload-formatters/edit.spec.js +++ b/cypress/e2e/console/shared/payload-formatters/edit.spec.js @@ -119,7 +119,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -137,7 +137,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -155,7 +155,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -173,7 +173,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -192,7 +192,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -217,7 +217,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -235,7 +235,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -253,7 +253,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -271,7 +271,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -290,7 +290,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -317,7 +317,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -377,7 +377,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -395,7 +395,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -413,7 +413,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -431,7 +431,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -456,7 +456,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -514,7 +514,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -532,7 +532,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -550,7 +550,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') @@ -568,7 +568,7 @@ describe('Payload formatters', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Payload formatter updated') .should('be.visible') diff --git a/cypress/e2e/console/user-settings/change-password.spec.js b/cypress/e2e/console/user-settings/change-password.spec.js index 1bcca3b6d5..42578c321c 100644 --- a/cypress/e2e/console/user-settings/change-password.spec.js +++ b/cypress/e2e/console/user-settings/change-password.spec.js @@ -59,7 +59,9 @@ describe('User settings / change password', () => { cy.findByLabelText('Revoke all access').check() cy.findByLabelText('Confirm new password').type(`${newPassword}{enter}`) - cy.findByTestId('toast-notification').should('be.visible').and('contain', 'Password changed') + cy.findByTestId('toast-notification-success') + .should('be.visible') + .and('contain', 'Password changed') }) it('succeeds changing password without revoking access', () => { @@ -68,6 +70,8 @@ describe('User settings / change password', () => { cy.findByLabelText('Confirm new password').type(newPassword) cy.findByRole('button', { name: 'Change password' }).click() - cy.findByTestId('toast-notification').should('be.visible').and('contain', 'Password changed') + cy.findByTestId('toast-notification-success') + .should('be.visible') + .and('contain', 'Password changed') }) }) diff --git a/cypress/e2e/console/user-settings/oauth-clients/edit.spec.js b/cypress/e2e/console/user-settings/oauth-clients/edit.spec.js index c133f9d856..edbba15bd1 100644 --- a/cypress/e2e/console/user-settings/oauth-clients/edit.spec.js +++ b/cypress/e2e/console/user-settings/oauth-clients/edit.spec.js @@ -49,7 +49,7 @@ describe('OAuth Client general settings', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText(`OAuth client updated`) .should('be.visible') diff --git a/cypress/e2e/console/user-settings/profile.spec.js b/cypress/e2e/console/user-settings/profile.spec.js index b7c4dcb443..110ab6b855 100644 --- a/cypress/e2e/console/user-settings/profile.spec.js +++ b/cypress/e2e/console/user-settings/profile.spec.js @@ -72,7 +72,7 @@ describe('User settings / profile', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Profile updated') .should('be.visible') @@ -99,7 +99,7 @@ describe('User settings / profile', () => { cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Profile updated') .should('be.visible') diff --git a/cypress/e2e/console/user-settings/session-management.spec.js b/cypress/e2e/console/user-settings/session-management.spec.js index 4559174708..ed1b6fb169 100644 --- a/cypress/e2e/console/user-settings/session-management.spec.js +++ b/cypress/e2e/console/user-settings/session-management.spec.js @@ -51,7 +51,7 @@ describe('User settings / session management', () => { }) cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .findByText('Session removed successfully') .should('be.visible') diff --git a/cypress/e2e/smoke/profile-settings/index.js b/cypress/e2e/smoke/profile-settings/index.js index 041ca7a8ce..d6782075dd 100644 --- a/cypress/e2e/smoke/profile-settings/index.js +++ b/cypress/e2e/smoke/profile-settings/index.js @@ -55,7 +55,7 @@ const profileSettingsNavigation = defineSmokeTest('succeeds navigating to Accoun cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Profile updated') .should('be.visible') diff --git a/cypress/e2e/smoke/user-settings/index.js b/cypress/e2e/smoke/user-settings/index.js index 4fe0bc7c9e..b1678cbf24 100644 --- a/cypress/e2e/smoke/user-settings/index.js +++ b/cypress/e2e/smoke/user-settings/index.js @@ -37,7 +37,7 @@ const profileSettingsNavigation = defineSmokeTest('succeeds navigating to Accoun .click() cy.findByRole('button', { name: 'Save changes' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification') + cy.findByTestId('toast-notification-success') .should('be.visible') .findByText('Profile updated') .should('be.visible') @@ -50,7 +50,9 @@ const profileSettingsNavigation = defineSmokeTest('succeeds navigating to Accoun cy.findByLabelText('Confirm new password').type('ABCDefg321!') cy.findByRole('button', { name: 'Change password' }).click() cy.findByTestId('error-notification').should('not.exist') - cy.findByTestId('toast-notification').should('be.visible').and('contain', 'Password changed') + cy.findByTestId('toast-notification-success') + .should('be.visible') + .and('contain', 'Password changed') cy.findByRole('link', { name: /API keys/ }) .should('be.visible') diff --git a/pkg/webui/components/toast/toast.js b/pkg/webui/components/toast/toast.js index 0d67b77e5f..9a7126129d 100644 --- a/pkg/webui/components/toast/toast.js +++ b/pkg/webui/components/toast/toast.js @@ -86,7 +86,7 @@ const createToast = () => { info={type === INFO} error={type === ERROR} warning={type === WARNING} - data-test-id="toast-notification" + data-test-id={`toast-notification-${type}`} /> )