Skip to content

Commit

Permalink
test: fixing tests for landing page changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitarora committed May 5, 2017
1 parent 6ae3068 commit 173d84b
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--The whole content below can be removed with the new code.-->
<div style="text-align:center">
<h1>
Welcome to {{title}}!!
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/tests/build/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export default function () {
});
});`,
}))
// .then(() => !ejected && ng('test', '--single-run'))
// .then(_ => killAllProcesses(), (err) => { killAllProcesses(); throw err; })
.then(() => ng('e2e'));
.then(() => !ejected && ng('test', '--single-run'))
.then(() => !ejected && ng('e2e'));
}
2 changes: 1 addition & 1 deletion tests/e2e/tests/misc/default-port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function() {
.then(() => ngServe())
.then(() => request('http://localhost:4201/'))
.then(body => {
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/misc/fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function () {
.then(() => ngServe())
.then(() => request('http://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
Expand All @@ -25,7 +25,7 @@ export default function () {
.then(() => ngServe())
.then(() => request('http://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
Expand Down
20 changes: 20 additions & 0 deletions tests/e2e/tests/misc/live-reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@ export default function () {

return Promise.resolve()
.then(_ => writeMultipleFiles({
'src/app/app.module.ts': `
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
`,
// e2e test that just opens the page and waits, so that the app runs.
'./e2e/app.e2e-spec.ts': `
import { browser } from 'protractor';
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/misc/ssl-default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function() {
.then(() => ngServe())
.then(() => request('https://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/misc/ssl-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function() {
.then(() => ngServe('--ssl', 'true'))
.then(() => request('https://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/misc/ssl-with-cert-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function() {
.then(() => ngServe())
.then(() => request('https://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/misc/ssl-with-cert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function() {
))
.then(() => request('https://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
Expand Down

0 comments on commit 173d84b

Please sign in to comment.