Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix(@schematics/angular): e2e should use the prefix
Browse files Browse the repository at this point in the history
Now that the CLI repects the prefix specified, the generated e2e test should also use it.
  • Loading branch information
cexbrayat authored and hansl committed May 14, 2018
1 parent 6b04749 commit 8a72879
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
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: options.prefix || 'app',
};
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.
*/
prefix?: string;
}
7 changes: 7 additions & 0 deletions packages/schematics/angular/e2e/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"relatedAppName": {
"description": "The name of the app being tested.",
"type": "string"
},
"prefix": {
"type": "string",
"format": "html-selector",
"description": "The prefix to apply to generated selectors.",
"default": "app",
"alias": "p"
}
},
"required": [
Expand Down

0 comments on commit 8a72879

Please sign in to comment.