Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

fix(@schematics/angular): fix e2e schematic to expect welcome message with prefix #865

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/schematics/angular/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default function (options: ApplicationOptions): Rule {
name: `${options.name}-e2e`,
relatedAppName: options.name,
rootSelector: appRootSelector,
prefix,
};
if (options.projectRoot !== undefined) {
e2eOptions.projectRoot = 'e2e';
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/e2e/files/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ describe('workspace-project App', () => {

it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
expect(page.getParagraphText()).toEqual('Welcome to <%= prefix %>!');
});
});
4 changes: 4 additions & 0 deletions packages/schematics/angular/e2e/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ export interface Schema {
* The name of the app being tested.
*/
relatedAppName: string;
/**
* The prefix to apply to generated selectors.
*/
prefix?: string;
}
6 changes: 6 additions & 0 deletions packages/schematics/angular/e2e/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"type": "string",
"default": "app-root"
},
"prefix": {
"type": "string",
"format": "html-selector",
"description": "The prefix to apply to generated selectors.",
"default": "app"
},
"relatedAppName": {
"description": "The name of the app being tested.",
"type": "string"
Expand Down