Skip to content

Commit 770b993

Browse files
clydinalan-agius4
authored andcommitted
test: update E2E tests to account for .ng.html template extension
1 parent dc2f659 commit 770b993

25 files changed

+54
-46
lines changed

Diff for: tests/legacy-cli/e2e/tests/basic/rebuild.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default async function () {
8383
await Promise.all([
8484
waitForAnyProcessOutputToMatch(validBundleRegEx),
8585
writeMultipleFiles({
86-
'src/app/app.component.html': '<h1>testingTESTING123</h1>',
86+
'src/app/app.component.ng.html': '<h1>testingTESTING123</h1>',
8787
}),
8888
]);
8989

Diff for: tests/legacy-cli/e2e/tests/build/app-shell/app-shell-with-schematic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { updateJsonFile } from '../../../utils/project';
77
const snapshots = require('../../../ng-snapshot/package.json');
88

99
export default async function () {
10-
await appendToFile('src/app/app.component.html', '<router-outlet></router-outlet>');
10+
await appendToFile('src/app/app.component.ng.html', '<router-outlet></router-outlet>');
1111
await ng('generate', 'app-shell', '--project', 'test-project');
1212

1313
const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];

Diff for: tests/legacy-cli/e2e/tests/build/app-shell/app-shell-with-service-worker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { updateJsonFile } from '../../../utils/project';
77
const snapshots = require('../../../ng-snapshot/package.json');
88

99
export default async function () {
10-
await appendToFile('src/app/app.component.html', '<router-outlet></router-outlet>');
10+
await appendToFile('src/app/app.component.ng.html', '<router-outlet></router-outlet>');
1111
await ng('generate', 'service-worker', '--project', 'test-project');
1212
await ng('generate', 'app-shell', '--project', 'test-project');
1313

Diff for: tests/legacy-cli/e2e/tests/build/library/setup.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ export async function libraryConsumptionSetup(): Promise<void> {
66

77
// Force an external template
88
await writeMultipleFiles({
9-
'projects/my-lib/src/lib/my-lib.component.html': `<p>my-lib works!</p>`,
9+
'projects/my-lib/src/lib/my-lib.component.ng.html': `<p>my-lib works!</p>`,
1010
'projects/my-lib/src/lib/my-lib.component.ts': `import { Component } from '@angular/core';
1111
1212
@Component({
1313
standalone: true,
1414
selector: 'lib-my-lib',
15-
templateUrl: './my-lib.component.html',
15+
templateUrl: './my-lib.component.ng.html',
1616
})
1717
export class MyLibComponent {}`,
1818
'./src/app/app.component.ts': `

Diff for: tests/legacy-cli/e2e/tests/build/prerender/error-with-sourcemaps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default async function () {
2828
selector: 'app-root',
2929
standalone: true,
3030
imports: [CommonModule, RouterOutlet],
31-
templateUrl: './app.component.html',
31+
templateUrl: './app.component.ng.html',
3232
styleUrls: ['./app.component.css']
3333
})
3434
export class AppComponent {

Diff for: tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-platform-neutral.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default async function () {
2727
await installPackage('h3@1');
2828

2929
await writeMultipleFiles({
30-
// Replace the template of app.component.html as it makes it harder to debug
31-
'src/app/app.component.html': '<router-outlet />',
30+
// Replace the template of app.component.ng.html as it makes it harder to debug
31+
'src/app/app.component.ng.html': '<router-outlet />',
3232
'src/app/app.routes.ts': `
3333
import { Routes } from '@angular/router';
3434
import { HomeComponent } from './home/home.component';

Diff for: tests/legacy-cli/e2e/tests/generate/component/component-basic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function () {
1111
.then(() => expectFileToExist(componentDir))
1212
.then(() => expectFileToExist(join(componentDir, 'test-component.component.ts')))
1313
.then(() => expectFileToExist(join(componentDir, 'test-component.component.spec.ts')))
14-
.then(() => expectFileToExist(join(componentDir, 'test-component.component.html')))
14+
.then(() => expectFileToExist(join(componentDir, 'test-component.component.ng.html')))
1515
.then(() => expectFileToExist(join(componentDir, 'test-component.component.css')))
1616

1717
// Try to run the unit tests.

Diff for: tests/legacy-cli/e2e/tests/generate/component/component-child-dir.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default async function () {
2121
const componentDirectory = join(childDirectory, 'test-component');
2222
await expectFileToExist(join(componentDirectory, 'test-component.component.ts'));
2323
await expectFileToExist(join(componentDirectory, 'test-component.component.spec.ts'));
24-
await expectFileToExist(join(componentDirectory, 'test-component.component.html'));
24+
await expectFileToExist(join(componentDirectory, 'test-component.component.ng.html'));
2525
await expectFileToExist(join(componentDirectory, 'test-component.component.css'));
2626

2727
// Ensure unit test execute and pass

Diff for: tests/legacy-cli/e2e/tests/generate/component/component-flat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function () {
1818
.then(() => expectFileToExist(appDir))
1919
.then(() => expectFileToExist(join(appDir, 'test-component.component.ts')))
2020
.then(() => expectFileToExist(join(appDir, 'test-component.component.spec.ts')))
21-
.then(() => expectFileToExist(join(appDir, 'test-component.component.html')))
21+
.then(() => expectFileToExist(join(appDir, 'test-component.component.ng.html')))
2222
.then(() => expectFileToExist(join(appDir, 'test-component.component.css')))
2323

2424
// Try to run the unit tests.

Diff for: tests/legacy-cli/e2e/tests/generate/component/component-inline-template.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export default function () {
2121
.then(() => expectFileToExist(join(componentDir, 'test-component.component.ts')))
2222
.then(() => expectFileToExist(join(componentDir, 'test-component.component.spec.ts')))
2323
.then(() =>
24-
expectToFail(() => expectFileToExist(join(componentDir, 'test-component.component.html'))),
24+
expectToFail(() =>
25+
expectFileToExist(join(componentDir, 'test-component.component.ng.html')),
26+
),
2527
)
2628
.then(() => expectFileToExist(join(componentDir, 'test-component.component.css')))
2729

Diff for: tests/legacy-cli/e2e/tests/generate/component/component-not-flat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function () {
1919
.then(() => expectFileToExist(componentDir))
2020
.then(() => expectFileToExist(join(componentDir, 'test-component.component.ts')))
2121
.then(() => expectFileToExist(join(componentDir, 'test-component.component.spec.ts')))
22-
.then(() => expectFileToExist(join(componentDir, 'test-component.component.html')))
22+
.then(() => expectFileToExist(join(componentDir, 'test-component.component.ng.html')))
2323
.then(() => expectFileToExist(join(componentDir, 'test-component.component.css')))
2424

2525
// Try to run the unit tests.

Diff for: tests/legacy-cli/e2e/tests/generate/component/component-path-case.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default async function () {
1616
// Ensure component is created in the correct location relative to the workspace root
1717
await expectFileToExist(join(componentDirectory, 'test-component.component.ts'));
1818
await expectFileToExist(join(componentDirectory, 'test-component.component.spec.ts'));
19-
await expectFileToExist(join(componentDirectory, 'test-component.component.html'));
19+
await expectFileToExist(join(componentDirectory, 'test-component.component.ng.html'));
2020
await expectFileToExist(join(componentDirectory, 'test-component.component.css'));
2121

2222
// Generate another component
@@ -25,7 +25,7 @@ export default async function () {
2525
// Ensure component is created in the correct location relative to the workspace root
2626
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.component.ts'));
2727
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.component.spec.ts'));
28-
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.component.html'));
28+
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.component.ng.html'));
2929
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.component.css'));
3030

3131
// Ensure unit test execute and pass

Diff for: tests/legacy-cli/e2e/tests/generate/generate-name-check.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function () {
1818
.then(() => expectFileToExist(compDir))
1919
.then(() => expectFileToExist(join(compDir, 'test-component.component.ts')))
2020
.then(() => expectFileToExist(join(compDir, 'test-component.component.spec.ts')))
21-
.then(() => expectFileToExist(join(compDir, 'test-component.component.html')))
21+
.then(() => expectFileToExist(join(compDir, 'test-component.component.ng.html')))
2222
.then(() => expectFileToExist(join(compDir, 'test-component.component.css')))
2323

2424
// Try to run the unit tests.

Diff for: tests/legacy-cli/e2e/tests/i18n/extract-ivy-disk-cache.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export default async function () {
1515

1616
// Setup an i18n enabled component
1717
await ng('generate', 'component', 'i18n-test');
18-
await writeFile(join('src/app/i18n-test', 'i18n-test.component.html'), '<p i18n>Hello world</p>');
18+
await writeFile(
19+
join('src/app/i18n-test', 'i18n-test.component.ng.html'),
20+
'<p i18n>Hello world</p>',
21+
);
1922

2023
await writeFile(
2124
'src/app/app.component.ts',

Diff for: tests/legacy-cli/e2e/tests/i18n/extract-ivy-libraries.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default async function () {
2424
);
2525

2626
await writeFile(
27-
'src/app/app.component.html',
27+
'src/app/app.component.ng.html',
2828
`
2929
<p i18n>Hello world</p>
3030
<lib-i18n-lib-test></lib-i18n-lib-test>
@@ -42,7 +42,7 @@ export default async function () {
4242
await ng('extract-i18n');
4343
await expectFileToMatch('messages.xlf', 'Hello world');
4444
await expectFileToMatch('messages.xlf', 'i18n-lib-test works!');
45-
await expectFileToMatch('messages.xlf', 'src/app/app.component.html');
45+
await expectFileToMatch('messages.xlf', 'src/app/app.component.ng.html');
4646
await expectFileToMatch(
4747
'messages.xlf',
4848
'projects/i18n-lib-test/src/lib/i18n-lib-test.component.ts',

Diff for: tests/legacy-cli/e2e/tests/i18n/extract-ivy.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { readNgVersion } from '../../utils/version';
99
export default async function () {
1010
// Setup an i18n enabled component
1111
await ng('generate', 'component', 'i18n-test');
12-
await writeFile(join('src/app/i18n-test', 'i18n-test.component.html'), '<p i18n>Hello world</p>');
12+
await writeFile(
13+
join('src/app/i18n-test', 'i18n-test.component.ng.html'),
14+
'<p i18n>Hello world</p>',
15+
);
1316
// Actually use the generated component to ensure it is present in the application output
1417
await writeFile(
1518
'src/app/app.component.ts',

Diff for: tests/legacy-cli/e2e/tests/i18n/ivy-localize-app-shell-service-worker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async function () {
1717
: readNgVersion();
1818
});
1919

20-
await appendToFile('src/app/app.component.html', '<router-outlet></router-outlet>');
20+
await appendToFile('src/app/app.component.ng.html', '<router-outlet></router-outlet>');
2121

2222
// Add app-shell and service-worker
2323
await silentNg('generate', 'app-shell');

Diff for: tests/legacy-cli/e2e/tests/i18n/ivy-localize-app-shell.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default async function () {
2323
: readNgVersion();
2424
});
2525

26-
await appendToFile('src/app/app.component.html', '<router-outlet></router-outlet>');
26+
await appendToFile('src/app/app.component.ng.html', '<router-outlet></router-outlet>');
2727
await ng('generate', 'app-shell', '--project', 'test-project');
2828

2929
if (isSnapshotBuild) {
@@ -62,15 +62,15 @@ export default async function () {
6262
});
6363

6464
await writeFile(
65-
'src/app/app-shell/app-shell.component.html',
65+
'src/app/app-shell/app-shell.component.ng.html',
6666
'<h1 i18n="An introduction header for this sample">Hello i18n!</h1>',
6767
);
6868

6969
// Add a translatable element
7070
// Extraction of i18n only works on browser targets.
7171
// Let's add the same translation that there is in the app-shell
7272
await writeFile(
73-
'src/app/app.component.html',
73+
'src/app/app.component.ng.html',
7474
'<h1 i18n="An introduction header for this sample">Hello i18n!</h1>',
7575
);
7676

@@ -79,9 +79,9 @@ export default async function () {
7979
await expectFileToMatch('src/locale/messages.xlf', `source-language="en-US"`);
8080
await expectFileToMatch('src/locale/messages.xlf', `An introduction header for this sample`);
8181

82-
// Clean up app.component.html so that we can easily
82+
// Clean up app.component.ng.html so that we can easily
8383
// find the translation text
84-
await writeFile('src/app/app.component.html', '<router-outlet></router-outlet>');
84+
await writeFile('src/app/app.component.ng.html', '<router-outlet></router-outlet>');
8585

8686
for (const { lang, translation } of langTranslations) {
8787
if (lang != 'en-US') {

Diff for: tests/legacy-cli/e2e/tests/i18n/setup.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export async function setupI18nConfig() {
108108
selector: 'app-root',
109109
imports: [DatePipe, RouterOutlet],
110110
standalone: true,
111-
templateUrl: './app.component.html'
111+
templateUrl: './app.component.ng.html'
112112
})
113113
export class AppComponent {
114114
constructor(@Inject(LOCALE_ID) public locale: string) { }
@@ -119,7 +119,7 @@ export async function setupI18nConfig() {
119119
`,
120120
);
121121
await writeFile(
122-
`src/app/app.component.html`,
122+
`src/app/app.component.ng.html`,
123123
`
124124
<p id="hello" i18n="An introduction header for this sample">Hello {{ title }}! </p>
125125
<p id="locale">{{ locale }}</p>
@@ -140,22 +140,22 @@ export async function setupI18nConfig() {
140140
<trans-unit id="4286451273117902052" datatype="html">
141141
<source>Hello <x id="INTERPOLATION" equiv-text="{{ title }}"/>! </source>
142142
<context-group purpose="location">
143-
<context context-type="sourcefile">src/app/app.component.html</context>
143+
<context context-type="sourcefile">src/app/app.component.ng.html</context>
144144
<context context-type="linenumber">2,3</context>
145145
</context-group>
146146
<note priority="1" from="description">An introduction header for this sample</note>
147147
</trans-unit>
148148
<trans-unit id="4606963464835766483" datatype="html">
149149
<source>Updated <x id="ICU" equiv-text="{minutes, plural, =0 {just now} =1 {one minute ago} other {{{minutes}} minutes ago}}" xid="1887283401472369100"/></source>
150150
<context-group purpose="location">
151-
<context context-type="sourcefile">src/app/app.component.html</context>
151+
<context context-type="sourcefile">src/app/app.component.ng.html</context>
152152
<context context-type="linenumber">5,6</context>
153153
</context-group>
154154
</trans-unit>
155155
<trans-unit id="2002272803511843863" datatype="html">
156156
<source>{VAR_PLURAL, plural, =0 {just now} =1 {one minute ago} other {<x id="INTERPOLATION"/> minutes ago}}</source>
157157
<context-group purpose="location">
158-
<context context-type="sourcefile">src/app/app.component.html</context>
158+
<context context-type="sourcefile">src/app/app.component.ng.html</context>
159159
<context context-type="linenumber">5,6</context>
160160
</context-group>
161161
</trans-unit>

Diff for: tests/legacy-cli/e2e/tests/misc/browsers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default async function () {
1111
}
1212

1313
// Workaround for https://github.com/angular/angular/issues/32192
14-
await replaceInFile('src/app/app.component.html', /class="material-icons"/g, '');
14+
await replaceInFile('src/app/app.component.ng.html', /class="material-icons"/g, '');
1515

1616
await ng('build');
1717

Diff for: tests/legacy-cli/e2e/tests/vite/ssr-entry-express.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export default async function () {
1919
await installWorkspacePackages();
2020

2121
await writeMultipleFiles({
22-
// Replace the template of app.component.html as it makes it harder to debug
23-
'src/app/app.component.html': '<router-outlet />',
22+
// Replace the template of app.component.ng.html as it makes it harder to debug
23+
'src/app/app.component.ng.html': '<router-outlet />',
2424
'src/app/app.routes.ts': `
2525
import { Routes } from '@angular/router';
2626
import { HomeComponent } from './home/home.component';
@@ -87,7 +87,7 @@ export default async function () {
8787

8888
// Modify the home component and validate the change.
8989
await modifyFileAndWaitUntilUpdated(
90-
'src/app/home/home.component.html',
90+
'src/app/home/home.component.ng.html',
9191
'home works',
9292
'yay home works!!!',
9393
true,

Diff for: tests/legacy-cli/e2e/tests/vite/ssr-entry-fastify.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default async function () {
2020
await installPackage('fastify@5');
2121

2222
await writeMultipleFiles({
23-
// Replace the template of app.component.html as it makes it harder to debug
24-
'src/app/app.component.html': '<router-outlet />',
23+
// Replace the template of app.component.ng.html as it makes it harder to debug
24+
'src/app/app.component.ng.html': '<router-outlet />',
2525
'src/app/app.routes.ts': `
2626
import { Routes } from '@angular/router';
2727
import { HomeComponent } from './home/home.component';
@@ -87,7 +87,7 @@ export default async function () {
8787

8888
// Modify the home component and validate the change.
8989
await modifyFileAndWaitUntilUpdated(
90-
'src/app/home/home.component.html',
90+
'src/app/home/home.component.ng.html',
9191
'home works',
9292
'yay home works!!!',
9393
true,

Diff for: tests/legacy-cli/e2e/tests/vite/ssr-entry-h3.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default async function () {
2020
await installPackage('h3@1');
2121

2222
await writeMultipleFiles({
23-
// Replace the template of app.component.html as it makes it harder to debug
24-
'src/app/app.component.html': '<router-outlet />',
23+
// Replace the template of app.component.ng.html as it makes it harder to debug
24+
'src/app/app.component.ng.html': '<router-outlet />',
2525
'src/app/app.routes.ts': `
2626
import { Routes } from '@angular/router';
2727
import { HomeComponent } from './home/home.component';
@@ -78,7 +78,7 @@ export default async function () {
7878

7979
// Modify the home component and validate the change.
8080
await modifyFileAndWaitUntilUpdated(
81-
'src/app/home/home.component.html',
81+
'src/app/home/home.component.ng.html',
8282
'home works',
8383
'yay home works!!!',
8484
true,

Diff for: tests/legacy-cli/e2e/tests/vite/ssr-entry-hono.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default async function () {
2020
await installPackage('hono@4');
2121

2222
await writeMultipleFiles({
23-
// Replace the template of app.component.html as it makes it harder to debug
24-
'src/app/app.component.html': '<router-outlet />',
23+
// Replace the template of app.component.ng.html as it makes it harder to debug
24+
'src/app/app.component.ng.html': '<router-outlet />',
2525
'src/app/app.routes.ts': `
2626
import { Routes } from '@angular/router';
2727
import { HomeComponent } from './home/home.component';
@@ -70,7 +70,7 @@ export default async function () {
7070

7171
// Modify the home component and validate the change.
7272
await modifyFileAndWaitUntilUpdated(
73-
'src/app/home/home.component.html',
73+
'src/app/home/home.component.ng.html',
7474
'home works',
7575
'yay home works!!!',
7676
true,

Diff for: tests/legacy-cli/e2e/tests/vite/ssr-with-ssl.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export default async function () {
1818
await installWorkspacePackages();
1919

2020
await writeMultipleFiles({
21-
// Replace the template of app.component.html as it makes it harder to debug
22-
'src/app/app.component.html': '<router-outlet />',
21+
// Replace the template of app.component.ng.html as it makes it harder to debug
22+
'src/app/app.component.ng.html': '<router-outlet />',
2323
'src/app/app.routes.ts': `
2424
import { Routes } from '@angular/router';
2525
import { HomeComponent } from './home/home.component';

0 commit comments

Comments
 (0)