-
Notifications
You must be signed in to change notification settings - Fork 364
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
change, test: [M3-7073, M3-7176] - Remove dcSpecificPricing
and objDcSpecificPricing
feature flags
#9881
change, test: [M3-7073, M3-7176] - Remove dcSpecificPricing
and objDcSpecificPricing
feature flags
#9881
Conversation
…nd summary assertions out of table context
{renderRegionPricingText(regionLabel ?? 'this region')} | ||
<StyledTypography> | ||
To create your first {regionId ? 'bucket' : 'access key'}, you need to | ||
enable Object Storage.{' '} | ||
</StyledTypography> |
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.
Now that we're not trying to render so many different versions of copy in the modal, I cleaned up the function and replaced it with the Typography directly.
it('renders the table row with unknown prices if a region is not selected', () => { | ||
const { container } = renderWithTheme( | ||
wrapWithTableBody( | ||
<PlanSelection | ||
idx={0} | ||
isCreate={true} | ||
onSelect={() => jest.fn()} | ||
type={mockPlan} | ||
/> | ||
) | ||
); | ||
|
||
expect(container.querySelector('[data-qa-plan-row]')).toBeInTheDocument(); | ||
expect(container.querySelector('[data-qa-plan-name]')).toHaveTextContent( | ||
mockPlan.heading | ||
); | ||
expect(container.querySelector('[data-qa-monthly]')).toHaveTextContent( | ||
'$--.--' | ||
); | ||
expect(container.querySelector('[data-qa-hourly]')).toHaveTextContent( | ||
'$--.--' | ||
); | ||
}); | ||
|
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.
This test is added twice because it tests in both desktop and mobile view.
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.
Have you considered using a test helper util to resize instead?
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.
Looking back at my comment, it was a little misleading. The tests are similar, but test slightly different things, since the desktop view tests that the unknown prices appear within a table and the mobile view tests that the unknown prices appear within cards.
The tests do already use the resizeScreenSize
util to test the desktop and mobile display of plan items. I could break the unknown price test cases out into a separate test, but I don't see how that would make much difference, since we'd still want to test that the UI displays unknown prices in both views.
// DC Dynamic price logic - DB creation flow is out of scope | ||
const isDatabaseCreateFlow = location.pathname.includes('/databases/create'); | ||
const price: PriceObject | undefined = !isDatabaseCreateFlow | ||
? getLinodeRegionPrice(type, selectedRegionId) | ||
: type.price; |
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.
This logic is necessary because the PlanSelection is used in the Database Create flow. Since it is out of scope for DC-specific pricing, we do not depend on a region selection to show prices; they are shown when the page loads.
@@ -15,8 +15,8 @@ import type { ExtendedType } from 'src/utilities/extendType'; | |||
* @returns pricing information for this specific linode type in a region | |||
*/ | |||
export const getLinodeRegionPrice = ( |
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.
Consolidated these two tests into one since getPrice
was a wrapper for getLinodeRegionPrice
.
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.
The changes in this file are due to consolidating tests.
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 clean up! The diff is crazy!
All pricing I've check looks good! While this sits in develop, I'll remain vigilat
packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeClusterDialog.tsx
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.
Huge cleanup! nice work
- code looks good and no UI regression noticed where I tested ✅
- unit tests all passed ✅
- clone-linode e2e failure seems legit ❌ (failed locally consistently)
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
it('renders the table row with unknown prices if a region is not selected', () => { | ||
const { container } = renderWithTheme( | ||
wrapWithTableBody( | ||
<PlanSelection | ||
idx={0} | ||
isCreate={true} | ||
onSelect={() => jest.fn()} | ||
type={mockPlan} | ||
/> | ||
) | ||
); | ||
|
||
expect(container.querySelector('[data-qa-plan-row]')).toBeInTheDocument(); | ||
expect(container.querySelector('[data-qa-plan-name]')).toHaveTextContent( | ||
mockPlan.heading | ||
); | ||
expect(container.querySelector('[data-qa-monthly]')).toHaveTextContent( | ||
'$--.--' | ||
); | ||
expect(container.querySelector('[data-qa-hourly]')).toHaveTextContent( | ||
'$--.--' | ||
); | ||
}); | ||
|
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.
Have you considered using a test helper util to resize instead?
@abailly-akamai - Should be ready for another look!
This was a legit failure but was not due to this PR. It was fixed in #9890, which was recently merged, so I merged in the latest |
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 addressing the feedback! All looks good per my previous review and test suites all passing - Ship it 🚢 !
…jDcSpecificPricing` feature flags (linode#9881) * Remove flag from Migrate dialog and Region selection * Remove flag from MNTP dialog and Linode Details Network tab * Remove flag from backups * Remove flag from invoices * Remove flag from Volumes and NodeBalancers * Remove OBJ flag from OBJ * Remove flag from linodes and kubernetes * Remove flags from dev tools and feature flags list * Remove flag on lke tests; fix HA in Create Cluster flow * Remove flags in Migrate test, OBJ test, and Volumes test * Remove flags in backup, clone, and create linode tests * Remove flags in nodebalancer test * Remove flag from billing test and consolidate... with failure WIP * Add changesets * Fix initial unknown prices for Database Create flow * Remove duplicate instances of "$5.00" by updating mock, move header and summary assertions out of table context * Make changelogs consistent * Address feedback: simplify dialog copy * Address feedback: make variable name more clear --------- Co-authored-by: Joe D'Amore <jdamore@linode.com>
Description 📝
Both phases of feature have been released. We want to make our changes permanent by removing the feature flag logic from our code.
Changes 🔄
List any change relevant to the reviewer.
dcSpecificPricing
andobjDcSpecificPricing
feature flags from/src
code, updating component logic and utils as necessaryvolumes/create-volume.spec.ts
linodes/migrate-linode.spec.ts
linodes/create-linode.spec.ts
linodes/backup-linode.spec.ts
linodes/clone-linode.spec.ts
kubernetes/lke-update.spec.ts
kubernetes/lke-create.spec.ts
objectStorage/enable-object-storage.spec.ts
nodebalancers/smoke-create-nodebal.spec.ts
billing/billing-invoices.spec.ts
Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
Jakarta, ID
orSao Paulo, BR
and compare that to a region without DC-specific prices (e.g.Newark, NJ
).Verification steps
(How to verify changes)
false
via Launch Darkly in the development environment (check the network requests)Confirm the following e2es pass:
As an Author I have considered 🤔
Check all that apply