Skip to content

Commit 0253bc9

Browse files
committed
test: update E2E tests to account for the .html template extension
Effectively reverts commit 770b993 while accounting for the `.component` change.
1 parent 90615a8 commit 0253bc9

25 files changed

+39
-41
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.ng.html': '<h1>testingTESTING123</h1>',
86+
'src/app/app.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.ng.html', '<router-outlet></router-outlet>');
10+
await appendToFile('src/app/app.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.ng.html', '<router-outlet></router-outlet>');
10+
await appendToFile('src/app/app.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.ng.html': `<p>my-lib works!</p>`,
9+
'projects/my-lib/src/lib/my-lib.html': `<p>my-lib works!</p>`,
1010
'projects/my-lib/src/lib/my-lib.ts': `import { Component } from '@angular/core';
1111
1212
@Component({
1313
standalone: true,
1414
selector: 'lib-my-lib',
15-
templateUrl: './my-lib.ng.html',
15+
templateUrl: './my-lib.html',
1616
})
1717
export class MyLibComponent {}`,
1818
'./src/app/app.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.ng.html',
31+
templateUrl: './app.html',
3232
styleUrls: ['./app.css']
3333
})
3434
export class App {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default async function () {
2828

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

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.ts')))
1313
.then(() => expectFileToExist(join(componentDir, 'test-component.spec.ts')))
14-
.then(() => expectFileToExist(join(componentDir, 'test-component.ng.html')))
14+
.then(() => expectFileToExist(join(componentDir, 'test-component.html')))
1515
.then(() => expectFileToExist(join(componentDir, 'test-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.ts'));
2323
await expectFileToExist(join(componentDirectory, 'test-component.spec.ts'));
24-
await expectFileToExist(join(componentDirectory, 'test-component.ng.html'));
24+
await expectFileToExist(join(componentDirectory, 'test-component.html'));
2525
await expectFileToExist(join(componentDirectory, 'test-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.ts')))
2020
.then(() => expectFileToExist(join(appDir, 'test-component.spec.ts')))
21-
.then(() => expectFileToExist(join(appDir, 'test-component.ng.html')))
21+
.then(() => expectFileToExist(join(appDir, 'test-component.html')))
2222
.then(() => expectFileToExist(join(appDir, 'test-component.css')))
2323

2424
// Try to run the unit tests.

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ export default function () {
2020
.then(() => expectFileToExist(componentDir))
2121
.then(() => expectFileToExist(join(componentDir, 'test-component.ts')))
2222
.then(() => expectFileToExist(join(componentDir, 'test-component.spec.ts')))
23-
.then(() =>
24-
expectToFail(() => expectFileToExist(join(componentDir, 'test-component.ng.html'))),
25-
)
23+
.then(() => expectToFail(() => expectFileToExist(join(componentDir, 'test-component.html'))))
2624
.then(() => expectFileToExist(join(componentDir, 'test-component.css')))
2725

2826
// Try to run the unit tests.

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.ts')))
2121
.then(() => expectFileToExist(join(componentDir, 'test-component.spec.ts')))
22-
.then(() => expectFileToExist(join(componentDir, 'test-component.ng.html')))
22+
.then(() => expectFileToExist(join(componentDir, 'test-component.html')))
2323
.then(() => expectFileToExist(join(componentDir, 'test-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.ts'));
1818
await expectFileToExist(join(componentDirectory, 'test-component.spec.ts'));
19-
await expectFileToExist(join(componentDirectory, 'test-component.ng.html'));
19+
await expectFileToExist(join(componentDirectory, 'test-component.html'));
2020
await expectFileToExist(join(componentDirectory, 'test-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.ts'));
2727
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.spec.ts'));
28-
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.ng.html'));
28+
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.html'));
2929
await expectFileToExist(join(componentTwoDirectory, 'test-component-two.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.ts')))
2020
.then(() => expectFileToExist(join(compDir, 'test-component.spec.ts')))
21-
.then(() => expectFileToExist(join(compDir, 'test-component.ng.html')))
21+
.then(() => expectFileToExist(join(compDir, 'test-component.html')))
2222
.then(() => expectFileToExist(join(compDir, 'test-component.css')))
2323

2424
// Try to run the unit tests.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ 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.ng.html'), '<p i18n>Hello world</p>');
18+
await writeFile(join('src/app/i18n-test', 'i18n-test.html'), '<p i18n>Hello world</p>');
1919

2020
await writeFile(
2121
'src/app/app.ts',

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async function () {
1717
await prependToFile('src/app/app.ts', `import { I18nLibTest } from 'i18n-lib-test';`);
1818

1919
await writeFile(
20-
'src/app/app.ng.html',
20+
'src/app/app.html',
2121
`
2222
<p i18n>Hello world</p>
2323
<lib-i18n-lib-test></lib-i18n-lib-test>
@@ -35,7 +35,7 @@ export default async function () {
3535
await ng('extract-i18n');
3636
await expectFileToMatch('messages.xlf', 'Hello world');
3737
await expectFileToMatch('messages.xlf', 'i18n-lib-test works!');
38-
await expectFileToMatch('messages.xlf', 'src/app/app.ng.html');
38+
await expectFileToMatch('messages.xlf', 'src/app/app.html');
3939
await expectFileToMatch('messages.xlf', 'projects/i18n-lib-test/src/lib/i18n-lib-test.ts');
4040

4141
await uninstallPackage('@angular/localize');

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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.ng.html'), '<p i18n>Hello world</p>');
12+
await writeFile(join('src/app/i18n-test', 'i18n-test.html'), '<p i18n>Hello world</p>');
1313
// Actually use the generated component to ensure it is present in the application output
1414
await writeFile(
1515
'src/app/app.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.ng.html', '<router-outlet></router-outlet>');
20+
await appendToFile('src/app/app.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

+4-4
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.ng.html', '<router-outlet></router-outlet>');
26+
await appendToFile('src/app/app.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.ng.html',
65+
'src/app/app-shell/app-shell.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.ng.html',
73+
'src/app/app.html',
7474
'<h1 i18n="An introduction header for this sample">Hello i18n!</h1>',
7575
);
7676

@@ -81,7 +81,7 @@ export default async function () {
8181

8282
// Clean up app.ng.html so that we can easily
8383
// find the translation text
84-
await writeFile('src/app/app.ng.html', '<router-outlet></router-outlet>');
84+
await writeFile('src/app/app.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.ng.html'
111+
templateUrl: './app.html'
112112
})
113113
export class App {
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.ng.html`,
122+
`src/app/app.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.ng.html</context>
143+
<context context-type="sourcefile">src/app/app.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.ng.html</context>
151+
<context context-type="sourcefile">src/app/app.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.ng.html</context>
158+
<context context-type="sourcefile">src/app/app.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.ng.html', /class="material-icons"/g, '');
14+
await replaceInFile('src/app/app.html', /class="material-icons"/g, '');
1515

1616
await ng('build');
1717

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default async function () {
2020

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

9595
// Modify the home component and validate the change.
9696
await modifyFileAndWaitUntilUpdated(
97-
'src/app/home/home.ng.html',
97+
'src/app/home/home.html',
9898
'home works',
9999
'yay home works!!!',
100100
true,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default async function () {
2121

2222
await writeMultipleFiles({
2323
// Replace the template of app.ng.html as it makes it harder to debug
24-
'src/app/app.ng.html': '<router-outlet />',
24+
'src/app/app.html': '<router-outlet />',
2525
'src/app/app.routes.ts': `
2626
import { Routes } from '@angular/router';
2727
import { Home } from './home/home';
@@ -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.ng.html',
90+
'src/app/home/home.html',
9191
'home works',
9292
'yay home works!!!',
9393
true,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default async function () {
2121

2222
await writeMultipleFiles({
2323
// Replace the template of app.ng.html as it makes it harder to debug
24-
'src/app/app.ng.html': '<router-outlet />',
24+
'src/app/app.html': '<router-outlet />',
2525
'src/app/app.routes.ts': `
2626
import { Routes } from '@angular/router';
2727
import { Home } from './home/home';
@@ -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.ng.html',
81+
'src/app/home/home.html',
8282
'home works',
8383
'yay home works!!!',
8484
true,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default async function () {
2121

2222
await writeMultipleFiles({
2323
// Replace the template of app.ng.html as it makes it harder to debug
24-
'src/app/app.ng.html': '<router-outlet />',
24+
'src/app/app.html': '<router-outlet />',
2525
'src/app/app.routes.ts': `
2626
import { Routes } from '@angular/router';
2727
import { Home } from './home/home';
@@ -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.ng.html',
73+
'src/app/home/home.html',
7474
'home works',
7575
'yay home works!!!',
7676
true,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async function () {
1919

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

0 commit comments

Comments
 (0)