forked from nrwl/nx
-
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.
feat(testing): support cypress 11 (nrwl#13075)
- Loading branch information
1 parent
a218149
commit 37c8483
Showing
11 changed files
with
913 additions
and
136 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
20 changes: 12 additions & 8 deletions
20
packages/angular/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__
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,23 @@ | ||
import { MountConfig } from 'cypress/angular'; | ||
import { TestBed } from '@angular/core/testing'; | ||
import { <%= componentName %> } from './<%= componentFileName %>'; | ||
|
||
describe(<%= componentName %>.name, () => { | ||
const config: MountConfig<<%= componentName %>> = { | ||
declarations: [], | ||
imports: [], | ||
providers: [] | ||
} | ||
|
||
beforeEach(() => { | ||
TestBed.overrideComponent(<%= componentName %>, { | ||
add: { | ||
imports: [], | ||
providers: [] | ||
} | ||
}) | ||
}) | ||
|
||
it('renders', () => { | ||
cy.mount(<%= componentName %>,<% if(props.length > 0) { %> { | ||
...config, | ||
componentProperties: {<% for (let prop of props) { %> | ||
<%= prop.name %>: <%- prop.defaultValue %>,<% } %> | ||
} | ||
}<% } else { %> config<% } %>); | ||
}<% } %>); | ||
}) | ||
|
||
}) |
Oops, something went wrong.