Skip to content

Commit 9209bc2

Browse files
authored
test: [M3-8430] - Mock disable OBJ Gen 2 flags for existing OBJ Cypress tests (#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
1 parent 0f5ae7e commit 9209bc2

File tree

6 files changed

+29
-11
lines changed

6 files changed

+29
-11
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tests
3+
---
4+
5+
Mock disable OBJ Gen 2 flags for existing OBJ Cypress tests ([#11191](https://github.com/linode/manager/pull/11191))

packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ describe('object storage access key end-to-end tests', () => {
3838
interceptGetAccessKeys().as('getKeys');
3939
interceptCreateAccessKey().as('createKey');
4040

41-
mockGetAccount(accountFactory.build({ capabilities: [] }));
41+
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
4242
mockAppendFeatureFlags({
4343
objMultiCluster: false,
44+
objectStorageGen2: { enabled: false },
4445
});
4546

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

135-
mockGetAccount(accountFactory.build({ capabilities: [] }));
136+
mockGetAccount(
137+
accountFactory.build({ capabilities: ['Object Storage'] })
138+
);
136139
mockAppendFeatureFlags({
137140
objMultiCluster: false,
141+
objectStorageGen2: { enabled: false },
138142
});
139143

140144
interceptGetAccessKeys().as('getKeys');

packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ describe('object storage access keys smoke tests', () => {
4242
secret_key: randomString(39),
4343
});
4444

45-
mockGetAccount(accountFactory.build({ capabilities: [] }));
45+
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
4646
mockAppendFeatureFlags({
4747
objMultiCluster: false,
48+
objectStorageGen2: { enabled: false },
4849
});
4950

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

116-
mockGetAccount(accountFactory.build({ capabilities: [] }));
117+
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
117118
mockAppendFeatureFlags({
118119
objMultiCluster: false,
120+
objectStorageGen2: { enabled: false },
119121
});
120122

121123
// Mock initial GET request to include an access key.
@@ -162,11 +164,12 @@ describe('object storage access keys smoke tests', () => {
162164
beforeEach(() => {
163165
mockGetAccount(
164166
accountFactory.build({
165-
capabilities: ['Object Storage Access Key Regions'],
167+
capabilities: ['Object Storage', 'Object Storage Access Key Regions'],
166168
})
167169
);
168170
mockAppendFeatureFlags({
169171
objMultiCluster: true,
172+
objectStorageGen2: { enabled: false },
170173
});
171174
});
172175

packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ describe('Object Storage enrollment', () => {
5656
* - Confirms that consistent pricing information is shown for all regions in the enable modal.
5757
*/
5858
it('can enroll in Object Storage', () => {
59-
mockGetAccount(accountFactory.build({ capabilities: [] }));
59+
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
6060
mockAppendFeatureFlags({
6161
objMultiCluster: false,
62+
objectStorageGen2: { enabled: false },
6263
});
6364

6465
const mockAccountSettings = accountSettingsFactory.build({

packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ describe('object storage end-to-end tests', () => {
183183
interceptDeleteBucket(bucketLabel, bucketCluster).as('deleteBucket');
184184
interceptGetNetworkUtilization().as('getNetworkUtilization');
185185

186-
mockGetAccount(accountFactory.build({ capabilities: [] }));
186+
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
187187
mockAppendFeatureFlags({
188188
objMultiCluster: false,
189+
objectStorageGen2: { enabled: false },
189190
}).as('getFeatureFlags');
190191

191192
cy.visitWithLogin('/object-storage');

packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ describe('object storage smoke tests', () => {
6060

6161
mockGetAccount(
6262
accountFactory.build({
63-
capabilities: ['Object Storage Access Key Regions'],
63+
capabilities: ['Object Storage', 'Object Storage Access Key Regions'],
6464
})
6565
);
6666
mockAppendFeatureFlags({
6767
objMultiCluster: true,
68+
objectStorageGen2: { enabled: false },
6869
}).as('getFeatureFlags');
6970

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

163-
mockGetAccount(accountFactory.build({ capabilities: [] }));
164+
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
164165
mockAppendFeatureFlags({
165166
objMultiCluster: false,
167+
objectStorageGen2: { enabled: false },
166168
gecko2: false,
167169
}).as('getFeatureFlags');
168170

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

300-
mockGetAccount(accountFactory.build({ capabilities: [] }));
302+
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
301303
mockAppendFeatureFlags({
302304
objMultiCluster: false,
305+
objectStorageGen2: { enabled: false },
303306
});
304307

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

349352
mockGetAccount(
350353
accountFactory.build({
351-
capabilities: ['Object Storage Access Key Regions'],
354+
capabilities: ['Object Storage', 'Object Storage Access Key Regions'],
352355
})
353356
);
354357
mockAppendFeatureFlags({
355358
objMultiCluster: true,
359+
objectStorageGen2: { enabled: false },
356360
});
357361

358362
mockGetBuckets([bucketMock]).as('getBuckets');

0 commit comments

Comments
 (0)