Skip to content

Commit 1747c8d

Browse files
subirjollySubir Jolly
andauthored
fix: reposition setfeatureflag function for gh tests (#6032)
Co-authored-by: Subir Jolly <sjolly@influxdata.com>
1 parent 8b88f22 commit 1747c8d

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

cypress/e2e/cloud/globalHeader.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('change-account change-org global header', () => {
3030
before(() => {
3131
cy.flush().then(() =>
3232
cy.signin().then(() => {
33+
cy.setFeatureFlagsNoNav(globalHeaderFeatureFlags)
3334
cy.request({
3435
method: 'GET',
3536
url: 'api/v2/orgs',
@@ -48,7 +49,6 @@ describe('change-account change-org global header', () => {
4849
// Preserve one session throughout.
4950
makeQuartzUseIDPEOrgID(idpeOrgID)
5051
Cypress.Cookies.preserveOnce('sid')
51-
cy.setFeatureFlags(globalHeaderFeatureFlags)
5252
})
5353

5454
afterEach(() => {
@@ -59,7 +59,6 @@ describe('change-account change-org global header', () => {
5959
it('does not render when API requests to quartz fail', () => {
6060
mockQuartzOutage()
6161
interceptPageReload()
62-
cy.setFeatureFlags(globalHeaderFeatureFlags)
6362
cy.visit('/')
6463
cy.wait('@getQuartzAccounts')
6564
cy.getByTestID('global-header--container').should('not.exist')
@@ -68,7 +67,6 @@ describe('change-account change-org global header', () => {
6867
describe('change org dropdown', () => {
6968
before(() => {
7069
makeQuartzUseIDPEOrgID(idpeOrgID)
71-
cy.setFeatureFlags(globalHeaderFeatureFlags)
7270
cy.visit('/')
7371
})
7472

@@ -147,7 +145,6 @@ describe('change-account change-org global header', () => {
147145
describe('change account dropdown', () => {
148146
beforeEach(() => {
149147
makeQuartzUseIDPEOrgID(idpeOrgID)
150-
cy.setFeatureFlags(globalHeaderFeatureFlags)
151148
})
152149

153150
before(() => {
@@ -218,7 +215,6 @@ describe('change-account change-org global header', () => {
218215
describe('user profile avatar', {scrollBehavior: false}, () => {
219216
before(() => {
220217
makeQuartzUseIDPEOrgID(idpeOrgID)
221-
cy.setFeatureFlags(globalHeaderFeatureFlags)
222218
cy.visit('/')
223219
})
224220

cypress/e2e/cloud/globalHeaderOrgMenuItems.test.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ describe('FREE: global header menu items test', () => {
1111
before(() => {
1212
cy.flush().then(() =>
1313
cy.signin().then(() => {
14+
cy.setFeatureFlagsNoNav(createOrgsFeatureFlags)
1415
cy.request({
1516
method: 'GET',
1617
url: 'api/v2/orgs',
@@ -19,8 +20,6 @@ describe('FREE: global header menu items test', () => {
1920
if (res.body.orgs) {
2021
idpeOrgID = res.body.orgs[0].id
2122
}
22-
23-
cy.setFeatureFlags(createOrgsFeatureFlags)
2423
})
2524
})
2625
)
@@ -31,9 +30,7 @@ describe('FREE: global header menu items test', () => {
3130
Cypress.Cookies.preserveOnce('sid')
3231

3332
makeQuartzUseIDPEOrgID(idpeOrgID)
34-
cy.visit('/').then(() => {
35-
cy.setFeatureFlags(createOrgsFeatureFlags)
36-
})
33+
cy.visit('/')
3734
})
3835

3936
it('has add more organizations in menu items', () => {
@@ -52,6 +49,7 @@ describe('PAYG: global header menu items test', () => {
5249
before(() => {
5350
cy.flush().then(() =>
5451
cy.signin().then(() => {
52+
cy.setFeatureFlagsNoNav(createOrgsFeatureFlags)
5553
cy.request({
5654
method: 'GET',
5755
url: 'api/v2/orgs',
@@ -62,17 +60,14 @@ describe('PAYG: global header menu items test', () => {
6260
}
6361

6462
Cypress.Cookies.preserveOnce('sid')
65-
cy.setFeatureFlags(createOrgsFeatureFlags)
6663
})
6764
})
6865
)
6966
})
7067

7168
beforeEach(() => {
7269
makeQuartzUseIDPEOrgID(idpeOrgID, 'pay_as_you_go')
73-
cy.visit('/').then(() => {
74-
cy.setFeatureFlags(createOrgsFeatureFlags)
75-
})
70+
cy.visit('/')
7671
})
7772

7873
it('PAYG: can check create organization menu item exists', () => {
@@ -91,6 +86,7 @@ describe('Contract: global header menu items test', () => {
9186
before(() => {
9287
cy.flush().then(() =>
9388
cy.signin().then(() => {
89+
cy.setFeatureFlagsNoNav(createOrgsFeatureFlags)
9490
cy.request({
9591
method: 'GET',
9692
url: 'api/v2/orgs',
@@ -101,17 +97,14 @@ describe('Contract: global header menu items test', () => {
10197
}
10298

10399
Cypress.Cookies.preserveOnce('sid')
104-
cy.setFeatureFlags(createOrgsFeatureFlags)
105100
})
106101
})
107102
)
108103
})
109104

110105
beforeEach(() => {
111106
makeQuartzUseIDPEOrgID(idpeOrgID, 'contract')
112-
cy.visit('/').then(() => {
113-
cy.setFeatureFlags(createOrgsFeatureFlags)
114-
})
107+
cy.visit('/')
115108
})
116109

117110
it('Contract: can check create organization menu item exists', () => {

0 commit comments

Comments
 (0)