Skip to content

Commit 4772f63

Browse files
authored
fix: update templates e2e to work with iox (#6574)
* fix: update templates e2e to work with iox * chore: check for 404 after visiting templates page
1 parent c8c4197 commit 4772f63

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

cypress/e2e/cloud/communityTemplates.test.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import {Organization} from '../../../src/types'
22

3-
describe.skip('Community Templates', () => {
3+
const isIOxOrg = Boolean(Cypress.env('useIox'))
4+
const isTSMOrg = !isIOxOrg
5+
6+
describe('Community Templates - TSM', () => {
47
beforeEach(() =>
58
cy.flush().then(() =>
69
cy.signin().then(() => {
7-
cy.get('@org').then(({id}: Organization) =>
8-
cy.fixture('routes').then(({orgs}) => {
9-
cy.visit(`${orgs}/${id}/settings/templates`)
10-
cy.getByTestID('tree-nav')
10+
cy.setFeatureFlags({
11+
showTemplatesInNewIOx: true,
12+
}).then(() => {
13+
cy.get('@org').then(({id}: Organization) => {
14+
cy.fixture('routes').then(({orgs}) => {
15+
cy.visit(`${orgs}/${id}/settings/templates`)
16+
cy.getByTestID('tree-nav').should('be.visible')
17+
})
1118
})
12-
)
19+
})
1320
})
1421
)
1522
)
@@ -260,3 +267,20 @@ describe.skip('Community Templates', () => {
260267
})
261268
})
262269
})
270+
271+
describe('Community Templates - IOx', () => {
272+
it('routes to 404 page when IOx user attempts to access Templates', () => {
273+
cy.skipOn(isTSMOrg)
274+
cy.flush()
275+
cy.signin()
276+
cy.fixture('routes').then(({orgs}) => {
277+
cy.get<Organization>('@org').then(({id}: Organization) => {
278+
cy.visit(`${orgs}/${id}/settings/templates`)
279+
cy.contains('404: Page Not Found')
280+
cy.getByTestID('tree-nav').should('be.visible')
281+
cy.clickNavBarItem('nav-item-settings')
282+
cy.getByTestID('templates--tab').should('not.exist')
283+
})
284+
})
285+
})
286+
})

0 commit comments

Comments
 (0)