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

test: [M3-8430] - Mock disable OBJ Gen 2 flags for existing OBJ Cypress tests #11191

Merged
merged 4 commits into from
Nov 13, 2024
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
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11191-tests-1730403446066.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Mock disable OBJ Gen 2 flags for existing OBJ Cypress tests ([#11191](https://github.com/linode/manager/pull/11191))
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ describe('object storage access key end-to-end tests', () => {
interceptGetAccessKeys().as('getKeys');
interceptCreateAccessKey().as('createKey');

mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
});

cy.visitWithLogin('/object-storage/access-keys');
Expand Down Expand Up @@ -132,9 +133,12 @@ describe('object storage access key end-to-end tests', () => {
).then(() => {
const keyLabel = randomLabel();

mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(
accountFactory.build({ capabilities: ['Object Storage'] })
);
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
});

interceptGetAccessKeys().as('getKeys');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ describe('object storage access keys smoke tests', () => {
secret_key: randomString(39),
});

mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
});

mockGetAccessKeys([]).as('getKeys');
Expand Down Expand Up @@ -113,9 +114,10 @@ describe('object storage access keys smoke tests', () => {
secret_key: randomString(39),
});

mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
});

// Mock initial GET request to include an access key.
Expand Down Expand Up @@ -162,11 +164,12 @@ describe('object storage access keys smoke tests', () => {
beforeEach(() => {
mockGetAccount(
accountFactory.build({
capabilities: ['Object Storage Access Key Regions'],
capabilities: ['Object Storage', 'Object Storage Access Key Regions'],
})
);
mockAppendFeatureFlags({
objMultiCluster: true,
objectStorageGen2: { enabled: false },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ describe('Object Storage enrollment', () => {
* - Confirms that consistent pricing information is shown for all regions in the enable modal.
*/
it('can enroll in Object Storage', () => {
mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
});

const mockAccountSettings = accountSettingsFactory.build({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,10 @@ describe('object storage end-to-end tests', () => {
interceptDeleteBucket(bucketLabel, bucketCluster).as('deleteBucket');
interceptGetNetworkUtilization().as('getNetworkUtilization');

mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
}).as('getFeatureFlags');

cy.visitWithLogin('/object-storage');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ describe('object storage smoke tests', () => {

mockGetAccount(
accountFactory.build({
capabilities: ['Object Storage Access Key Regions'],
capabilities: ['Object Storage', 'Object Storage Access Key Regions'],
})
);
mockAppendFeatureFlags({
objMultiCluster: true,
objectStorageGen2: { enabled: false },
}).as('getFeatureFlags');

mockGetRegions(mockRegions).as('getRegions');
Expand Down Expand Up @@ -160,9 +161,10 @@ describe('object storage smoke tests', () => {
hostname: bucketHostname,
});

mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
gecko2: false,
}).as('getFeatureFlags');

Expand Down Expand Up @@ -297,9 +299,10 @@ describe('object storage smoke tests', () => {
objects: 0,
});

mockGetAccount(accountFactory.build({ capabilities: [] }));
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objectStorageGen2: { enabled: false },
});

mockGetBuckets([bucketMock]).as('getBuckets');
Expand Down Expand Up @@ -348,11 +351,12 @@ describe('object storage smoke tests', () => {

mockGetAccount(
accountFactory.build({
capabilities: ['Object Storage Access Key Regions'],
capabilities: ['Object Storage', 'Object Storage Access Key Regions'],
})
);
mockAppendFeatureFlags({
objMultiCluster: true,
objectStorageGen2: { enabled: false },
});

mockGetBuckets([bucketMock]).as('getBuckets');
Expand Down