Skip to content

Commit

Permalink
test: [M3-8430] - Mock disable OBJ Gen 2 flags for existing OBJ Cypre…
Browse files Browse the repository at this point in the history
…ss tests (linode#11191)

* update existing obj cypress tests to mock obj gen 2 flags as disabled

* update access-key spec

* Added changeset: Mock disable OBJ Gen 2 flags for existing OBJ Cypress tests
  • Loading branch information
coliu-akamai authored and santoshp210-akamai committed Nov 14, 2024
1 parent ec58e81 commit 5ea7518
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
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

0 comments on commit 5ea7518

Please sign in to comment.