Skip to content
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

fix: create-volume.spec.ts and dynamicPricing.test.ts #9578

Merged
merged 5 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Fix volume e2e test and dc specific price unit test ([#9578](https://github.com/linode/manager/pull/9578))
27 changes: 27 additions & 0 deletions packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { interceptCreateVolume } from 'support/intercepts/volumes';
import { randomNumber, randomString, randomLabel } from 'support/util/random';
import { chooseRegion } from 'support/util/regions';
import { ui } from 'support/ui';
import { makeFeatureFlagData } from 'support/util/feature-flags';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';

// Local storage override to force volume table to list up to 100 items.
// This is a workaround while we wait to get stuck volumes removed.
Expand Down Expand Up @@ -35,16 +40,29 @@ describe('volume create flow', () => {
regionLabel: region.label,
};

mockAppendFeatureFlags({
dcSpecificPricing: makeFeatureFlagData(false),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

interceptCreateVolume().as('createVolume');

cy.visitWithLogin('/volumes/create', {
localStorageOverrides: pageSizeOverride,
});

cy.wait(['@getFeatureFlags', '@getClientStream']);

// Fill out and submit volume create form.
containsClick('Label').type(volume.label);
containsClick('Size').type(`{selectall}{backspace}${volume.size}`);
containsClick('Select a Region').type(`${volume.region}{enter}`);

cy.findByText('Region')
.should('be.visible')
.click()
.type(`${volume.regionLabel}{enter}`);

fbtClick('Create Volume');
cy.wait('@createVolume');

Expand Down Expand Up @@ -85,11 +103,20 @@ describe('volume create flow', () => {
};

cy.defer(createLinode(linodeRequest), 'creating Linode').then((linode) => {
mockAppendFeatureFlags({
dcSpecificPricing: makeFeatureFlagData(false),
}).as('getFeatureFlags');

mockGetFeatureFlagClientstream().as('getClientStream');

interceptCreateVolume().as('createVolume');

cy.visitWithLogin('/volumes/create', {
localStorageOverrides: pageSizeOverride,
});

cy.wait(['@getFeatureFlags', '@getClientStream']);

// Fill out and submit volume create form.
containsClick('Label').type(volume.label);
containsClick('Size').type(`{selectall}{backspace}${volume.size}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('getDCSpecificPricingDisplay', () => {
flags: { dcSpecificPricing: true },
regionId: 'br-gru',
})
).toBe('26.00');
).toBe('28.00');
});

it('calculates dynamic pricing for a volumes based on size', () => {
Expand Down