Skip to content

Commit 37a1225

Browse files
filipesilvahansl
authored andcommitted
fix(e2e): fix broken test pipeline (#2999)
1 parent 86f2a1b commit 37a1225

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

packages/angular-cli/blueprints/component/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ module.exports = {
124124
const returns = [];
125125
const className = stringUtils.classify(`${options.entity.name}Component`);
126126
const fileName = stringUtils.dasherize(`${options.entity.name}.component`);
127-
const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath).toLowerCase();
127+
const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath);
128128
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
129129

130130
if (!options['skip-import']) {

packages/angular-cli/blueprints/directive/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module.exports = {
8787
const fileName = stringUtils.dasherize(`${options.entity.name}.directive`);
8888
const fullGeneratePath = path.join(this.project.root, this.generatePath);
8989
const moduleDir = path.parse(this.pathToModule).dir;
90-
const relativeDir = path.relative(moduleDir, fullGeneratePath).toLowerCase();
90+
const relativeDir = path.relative(moduleDir, fullGeneratePath);
9191
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
9292

9393
if (!options['skip-import']) {

packages/angular-cli/blueprints/pipe/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module.exports = {
7575
const fileName = stringUtils.dasherize(`${options.entity.name}.pipe`);
7676
const fullGeneratePath = path.join(this.project.root, this.generatePath);
7777
const moduleDir = path.parse(this.pathToModule).dir;
78-
const relativeDir = path.relative(moduleDir, fullGeneratePath).toLowerCase();
78+
const relativeDir = path.relative(moduleDir, fullGeneratePath);
7979
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
8080

8181
if (!options['skip-import']) {

tests/e2e/tests/build/styles/styles-array.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ export default function() {
4747
.then(() => expectFileToMatch('dist/styles.bundle.js', /.upper.*.lower.*background.*#def/))
4848

4949
.then(() => ng('build', '--prod'))
50-
.then(() => new Promise<string>(() =>
51-
glob.sync('dist/styles.*.bundle.css').find(file => !!file)))
50+
.then(() => glob.sync('dist/styles.*.bundle.css').find(file => !!file))
5251
.then((styles) =>
53-
expectFileToMatch(styles, 'body { background-color: blue; }')
54-
.then(() => expectFileToMatch(styles, 'p { background-color: red; }')
52+
expectFileToMatch(styles, /body\s*\{\s*background-color:\s*blue\s*\}/)
53+
.then(() => expectFileToMatch(styles, /p\s*\{\s*background-color:\s*red\s*\}/)
5554
.then(() => expectFileToMatch(styles, /.outer.*.inner.*background:\s*#[fF]+/))
5655
.then(() => expectFileToMatch(styles, /.upper.*.lower.*background.*#def/)))
5756
);

tests/e2e/tests/generate/component/component-path-case.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ import {expectFileToExist, createDir} from '../../../utils/fs';
44

55

66
export default function() {
7-
const rootDir = join('src', 'app', 'upper-dir');
8-
const componentDir = join(rootDir.toLowerCase(), 'test-component');
7+
const rootDir = join('src', 'app', 'Upper-Dir');
98
createDir(rootDir);
9+
const componentDir = join(rootDir, 'test-component');
10+
const componentTwoDir = join(rootDir, 'test-component-two');
1011

11-
return ng('generate', 'component', 'Upper-Dir', 'test-component')
12+
return ng('generate', 'component', 'Upper-Dir/test-component')
1213
.then(() => expectFileToExist(componentDir))
1314
.then(() => expectFileToExist(join(componentDir, 'test-component.component.ts')))
1415
.then(() => expectFileToExist(join(componentDir, 'test-component.component.spec.ts')))
1516
.then(() => expectFileToExist(join(componentDir, 'test-component.component.html')))
1617
.then(() => expectFileToExist(join(componentDir, 'test-component.component.css')))
18+
.then(() => ng('generate', 'component', 'Upper-Dir/Test-Component-Two'))
19+
.then(() => expectFileToExist(join(componentTwoDir, 'test-component-two.component.ts')))
20+
.then(() => expectFileToExist(join(componentTwoDir, 'test-component-two.component.spec.ts')))
21+
.then(() => expectFileToExist(join(componentTwoDir, 'test-component-two.component.html')))
22+
.then(() => expectFileToExist(join(componentTwoDir, 'test-component-two.component.css')))
1723

1824
// Try to run the unit tests.
1925
.then(() => ng('test', '--watch=false'));

0 commit comments

Comments
 (0)