-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: [M3-7091] - Add integration tests for Cloud Manager invoices, DC-specific pricing #9674
test: [M3-7091] - Add integration tests for Cloud Manager invoices, DC-specific pricing #9674
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 🤯🎉 Thanks joe!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @jdamore-linode!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thanks for this added coverage! All passing and overall looking clear and good.
I just left a question related to mock invoice items and a small ask to update the TODOs so that they're easier to find later. If you think we need a separate ticket beside M3-7073 for this, let me know and I will make one.
packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates! Confirmed tests are still all passing locally; this looks ready to 🚢 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran locally, all looking good 👍
* - Confirms that the expected invoice items are shown for each page. | ||
* - Confirms that page updates to reflect changes to page size selection. | ||
*/ | ||
it('paginates the list of invoice items for large invoices', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this belongs to an integration test as it's not relevant to the billing table alone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abailly-akamai Just to clarify, when I talk about integration tests, I'm usually referring to UI tests which use mock API data to confirm that a Cloud Manager feature/flow works with the system (in our case, the backend) as a whole without actually depending on it. Similarly, when I talk about end-to-end tests I'm still talking about UI tests, but which use real API requests to validate features and flows across the whole stack.
I think you're talking more about component testing (and I think an argument can be made that a component test is a form of an integration test, which is why I hate software testing terminology 😅), but we don't really have the capability to do component testing beyond what we're already doing with Jest. Cypress added component testing functionality relatively recently, which would probably be a great middle ground between our Jest tests and our Cypress UI tests, but they would exist as a separate suite of tests (and would therefore require pipeline changes, etc., to accommodate). To your point, the pagination components would be great candidates for component testing since they're used all over the place and their existing test coverage is somewhat lacking (1, 2).
However, the Pagination components still leave a lot up to the developer when it comes time for implementation: handling the page changing, or the pagination size changing, and fetching/transforming/providing the paginated data is all outside the scope of the <PaginationFooter />
component, for example (the usePagination()
hook helps mitigate the first two points, but it's only a convention; there's no guarantee that every paginated view uses that hook, and indeed, the Billing Activity panel's pagination logic does not). All of this is to say that a test which confirms that the Pagination component(s) work doesn't necessarily confirm that all of our paginated tables across the app work, too.
I don't think we should go testing pagination for every single paginated view in Cloud, but given the importance of the billing sections, and the fact that we do some funky stuff with combining API data from two endpoints on the Billing Activity Panel and paginating it together, I think it's probably good to have these specific implementations covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying, i understand why it's relevant here. Yeah in my head a component test is a form of integration test, cause you'd want to test it so that given a certain set of data it will always return the same result (they're both UI tests), but i understand the separation of concern here. Also, everything is a component I guess...
We could also do component testing at the Storybook level if we wanted, but prob better to leave this for the next component library we adopt unless it's really crucial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a really old spike ticket to explore Cypress component testing, and I think there may be a similar spike to look into Storybook's component testing. They were never a high priority and eventually slipped through the cracks, but in light of our new quality/reliability push, it might be worth prioritizing this. (Might be a good opportunity to look into visual regression testing too)
…oices, DC-specific pricing (linode#9674)" This reverts commit 1fa778f.
…C-specific pricing (linode#9674) * Move billing and payment tests to their own directory * Refactor billing activity smoke tests * Add invoice-related QA data attributes * Add pagination-related QA data attributes * Add invoice tests
…oices, DC-specific pricing (linode#9674)" This reverts commit 1fa778f.
Description 📝
Refactors existing tests and adds new tests to improve Cloud Manager's test coverage for invoices and to account for DC-specific pricing changes.
Major Changes 🔄
cy.visitWithLogin()
/account/billing
data-qa-*
attributes insrc
to facilitate testsHow to test 🧪
yarn && yarn build && yarn start:manager:ci
, and then:yarn cy:run -s "cypress/e2e/core/billing/billing-invoices.spec.ts,cypress/e2e/core/billing/smoke-billing-activity.spec.ts"