|
1 | 1 | import {Organization} from '../../../src/types' |
2 | 2 |
|
3 | | -describe.skip('Community Templates', () => { |
| 3 | +const isIOxOrg = Boolean(Cypress.env('useIox')) |
| 4 | +const isTSMOrg = !isIOxOrg |
| 5 | + |
| 6 | +describe('Community Templates - TSM', () => { |
4 | 7 | beforeEach(() => |
5 | 8 | cy.flush().then(() => |
6 | 9 | 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 | + }) |
11 | 18 | }) |
12 | | - ) |
| 19 | + }) |
13 | 20 | }) |
14 | 21 | ) |
15 | 22 | ) |
@@ -260,3 +267,20 @@ describe.skip('Community Templates', () => { |
260 | 267 | }) |
261 | 268 | }) |
262 | 269 | }) |
| 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