-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cwn-dashboard): added a preview of the customizable navbar
- Loading branch information
1 parent
e19842c
commit b41864b
Showing
5 changed files
with
176 additions
and
69 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
cypress/tests/integration/admin/global/navbarPreview.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
describe('navbarPreview', { defaultCommandTimeout: 5000 }, () => { | ||
beforeEach(() => { | ||
cy.viewport(1440, 1080); | ||
}); | ||
it('should not exist yet', () => { | ||
cy.visit('/admin/global'); | ||
cy.get('My Test Link').should('not.exist'); | ||
}); | ||
it('should add a new tab', () => { | ||
// Add first tab | ||
cy.get('[data-cy="addNavButton"]').click(); | ||
cy.get('[data-cy="customizeNavName"]').contains('New Url').click(); | ||
cy.get('input[name="title"][value="New Url"]').clear().type('My Test Link'); | ||
cy.get('input[name="url"][value="/new-url"]').clear().type('/My-Test-Link'); | ||
cy.contains('Update').click(); | ||
|
||
// Add second tab | ||
cy.get('[data-cy="addNavButton"]').click(); | ||
cy.get('[data-cy="customizeNavName"]').contains('New Url').click(); | ||
cy.get('input[name="title"][value="New Url"]') | ||
.clear() | ||
.type('My Test Link 2'); | ||
cy.get('input[name="url"][value="/new-url"]') | ||
.clear() | ||
.type('/My-Test-Link-2'); | ||
cy.get('[data-cy="customizeNavName"]') | ||
.siblings() | ||
.find('button') | ||
.contains('Update') | ||
.click(); | ||
}); | ||
|
||
it('should remove a tab', () => { | ||
cy.contains('My Test Link 2') | ||
.siblings() | ||
.find('[data-testid="DeleteIcon"]') | ||
.click(); | ||
cy.contains('My Test Link 2').should('not.exist'); | ||
}); | ||
|
||
it('should update a tab', () => { | ||
cy.get('input[name="title"][value="My Test Link"]') | ||
.clear() | ||
.type('UpdatedLink'); | ||
cy.get('input[name="url"][value="/My-Test-Link"]') | ||
.clear() | ||
.type('/UpdatedLink'); | ||
cy.get('[data-cy="customizeNavName"]') | ||
.siblings() | ||
.find('button') | ||
.contains('Update') | ||
.click(); | ||
}); | ||
|
||
it('should navigate to new url tab', () => { | ||
cy.get('[data-cy="addNavButton"]').click(); | ||
cy.get('[data-cy="customizeNavName"]').contains('New Url').click(); | ||
cy.get('input[name="title"][value="New Url"]').clear().type('Home'); | ||
cy.get('input[name="url"][value="/new-url"]') | ||
.clear() | ||
.type('https://greenstand.org/home'); | ||
cy.get('[data-cy="customizeNavName"]') | ||
.siblings() | ||
.find('button') | ||
.contains('Update') | ||
.click(); | ||
cy.get('a[href="https://greenstand.org/home"]').click(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters