Skip to content
Snippets Groups Projects
Commit d7e11d4f authored by bhill6@wisc.edu's avatar bhill6@wisc.edu
Browse files

ROENROLL-1204: Fixed some test errors, then got ci build/deploy working

parent ef1cd4f7
No related branches found
No related tags found
No related merge requests found
image: docker.doit.wisc.edu/registrar/angular-cli-builder:1.2.0
variables:
S3_BUCKET_NAME: dev-enroll-app-frontend
DEV_CFDIST_ID: E2LLRLV3LNB0E3
stages:
- build
# - test
- deploy
build:
stage: build
script:
- npm install
- ng build --prod --base-href /degree-planner
- ng lint
#test:
# stage: test
# script:
# - npm install
# - ng build --prod
deploy:
stage: deploy
script:
- npm install
- ng build --prod --base-href /degree-planner
- aws s3 sync --acl public-read --sse --delete dist/course-search-enroll-fe s3://$S3_BUCKET_NAME
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $DEV_CFDIST_ID --paths '/*'
only:
- master@adi-ia/course-search-enroll-fe
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"test": "ng test", "test": "ng test",
"lint": "ng lint", "lint": "ng lint",
"e2e": "ng e2e", "e2e": "ng e2e",
"build-prod": "npm version patch && node ./update-version.js && ng build --prod" "build-prod": "npm version patch && node ./update-version.js"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
......
...@@ -4,12 +4,13 @@ import { Router, RouterModule, Routes } from '@angular/router'; ...@@ -4,12 +4,13 @@ import { Router, RouterModule, Routes } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { AppRoutingModule } from './app.routing.module'; import { AppRoutingModule } from './app.routing.module';
const routes: Routes = [ const routes: Routes = [
{ path: '', pathMatch: 'full', redirectTo: 'home', }, {
{ path: 'home', component: HomeComponent } path: '',
loadChildren: './degree-planner/degree-planner.module#DegreePlannerModule'
}
]; ];
@Component({ @Component({
...@@ -29,8 +30,7 @@ describe('AppComponent', () => { ...@@ -29,8 +30,7 @@ describe('AppComponent', () => {
imports: [RouterModule, RouterTestingModule.withRoutes(routes)], imports: [RouterModule, RouterTestingModule.withRoutes(routes)],
schemas: [ NO_ERRORS_SCHEMA ], schemas: [ NO_ERRORS_SCHEMA ],
declarations: [ declarations: [
AppComponent, AppComponent
HomeComponent
], ],
}).compileComponents(); }).compileComponents();
})); }));
...@@ -39,17 +39,7 @@ describe('AppComponent', () => { ...@@ -39,17 +39,7 @@ describe('AppComponent', () => {
const app = fixture.debugElement.componentInstance; const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy(); expect(app).toBeTruthy();
})); }));
it(`should have as title 'Angular Starter'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Angular Starter');
}));
it('should render title in a router-outlet tag', async(() => { it('should render title in a router-outlet tag', async(() => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges(); fixture.detectChanges();
......
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
<a mat-tab-link routerLink="/degree-planner" routerLinkActive="active" >Degree Planner</a> <a mat-tab-link routerLink="/degree-planner" routerLinkActive="active" >Degree Planner</a>
</nav> </nav>
<router-outlet></router-outlet>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment