test: [DI-30129] - Add spec for show details notification channel#13449
Conversation
…ion_linode_February_28
…ion_linode_February_28
…ion_linode_February_28
…ion_linode_February_28
…ion_linode_February_28
…ion_linode_February_28
Cloud Manager UI test results🔺 5 failing tests on test run #8 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts,cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts,cypress/e2e/core/objectStorage/access-key.e2e.spec.ts,cypress/e2e/core/parentChild/account-switching.spec.ts" |
|||||||||||||||||||||||||||||
jdamore-linode
left a comment
There was a problem hiding this comment.
@shnagend-akamai the only thing stopping me from approving is the const assignments which aren't valid in Cypress. Feel free to ping me in Slack if I can lend a hand 👍
| ui.heading.findByText('label').click(); | ||
|
|
||
| // Get the sort order and verify data matches | ||
| const AlertNameHeading = ui.heading.findByText('label'); |
There was a problem hiding this comment.
We can't assign the result of Cypress commands to variables/constants because Cypress commands run after code execution. Try using an alias instead:
ui.heading.findByText('label').as('alertNameHeading');
cy.get('@alertNameHeading').should('have.attr', 'aria-sort').then(...)There are a few places in this PR where I think similar changes will need to be made.
Further reading:
| if (sortOrder === 'ascending') { | ||
| expectedAlerts = [...mockAlerts].sort((a, b) => | ||
| a.label.localeCompare(b.label) | ||
| ); | ||
| } else { | ||
| expectedAlerts = [...mockAlerts].sort((a, b) => | ||
| b.label.localeCompare(a.label) | ||
| ); |
There was a problem hiding this comment.
Not a huge deal, but rather than checking the state of the sort order and responding accordingly, it's generally better to set up the state in the way that's expected (e.g. through interactions and by mocking the user preferences when the page loads, etc.) and then assert that the sorting order is as expected.
Description 📝
This PR introduces integration test coverage for the Notification Channel Show Details page in the CloudPulse Alerts section of the Linode Manager application.
Changes 🔄
Adds show details spec with integration tests for the Notification Channel Show Details page.
Covers detail validation, Associated Alerts table (search, filter, sort, pagination), and navigation to alert detail pages.
Handles error scenarios: 500 responses for channel/alerts fetches, empty alerts state, and channel load failure.
Adds API intercepts and enables all seven service types to prevent alerts from being filtered out during tests.
Also fixes few existing test specs to accept CloudPulseServiceMap updated values.
Target release date 🗓️
Upcoming release
Preview 📷
alert-show-notification-channel.spec.ts.2.mp4
How to test 🧪
pnpm cy:run -s "cypress/e2e/core/cloudpulse/alert-show-notification-channel.spec.ts"
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅