-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update documentations; enable cypress e2e and component tests;
- Loading branch information
Showing
21 changed files
with
12,514 additions
and
16,175 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
import { defineConfig } from "cypress"; | ||
import { defineConfig } from 'cypress'; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
'baseUrl': 'http://localhost:4200', | ||
'specPattern': 'projects/dev-app/cypress/e2e/**/*.cy.ts', | ||
baseUrl: 'http://localhost:4200', | ||
specPattern: 'cypress/e2e/**/*.cy.ts', | ||
}, | ||
|
||
component: { | ||
devServer: { | ||
framework: 'angular', | ||
bundler: 'webpack', | ||
}, | ||
'specPattern': 'projects/nested-nav-list/cypress/component/**/*.cy.ts', | ||
specPattern: 'projects/nested-nav-list/src/lib/**/*.cy.ts', | ||
supportFile: 'cypress/support/component.ts', | ||
}, | ||
}); |
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,42 @@ | ||
describe('My First Test', () => { | ||
it('Visits the initial project page', () => { | ||
cy.visit('/'); | ||
cy.contains('Angular Material Nested Navigation List'); | ||
}); | ||
|
||
it ('Check if the nested nav list is displayed', () => { | ||
cy.visit('/'); | ||
cy.get('mat-nav-list').should('exist'); | ||
cy.contains('Home'); | ||
cy.contains('Profile').should('not.exist'); | ||
cy.contains('Settings').click(); | ||
cy.contains('Profile'); | ||
cy.contains('Notifications'); | ||
cy.contains('Repo'); | ||
}); | ||
|
||
it('Check navigation', () => { | ||
cy.visit('/'); | ||
cy.contains('Settings').click(); | ||
cy.contains('Profile').click(); | ||
cy.url().should('include', '/profile'); | ||
cy.contains('Home').click(); | ||
cy.url().should('include', '/home'); | ||
|
||
cy.window().then((win) => { | ||
cy.stub(win, 'open').as('windowOpen'); | ||
}); | ||
cy.get('mat-list-item:contains("Repo")').click(); | ||
cy.get('@windowOpen').should('be.calledWith', 'about:blank', '_blank'); | ||
}); | ||
|
||
it('SVG icon should be displayed', () => { | ||
cy.visit('/'); | ||
|
||
cy.get('mat-list-item:contains("Repo")').find('mat-icon[matlistitemicon]').find('svg').should('exist'); | ||
|
||
cy.get('ngx-nested-nav-list').should('have.class', 'override-svg-icon-color'); | ||
cy.contains('Keep Svg Icon Color').click(); | ||
cy.get('ngx-nested-nav-list').should('not.have.class', 'override-svg-icon-color'); | ||
}); | ||
}); |
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,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>Components App</title> | ||
</head> | ||
<body> | ||
<div data-cy-root></div> | ||
</body> | ||
</html> |
Oops, something went wrong.