diff --git a/apps/testing-router-outlet/src/app/app.component.cy.ts b/apps/testing-router-outlet/src/app/app.component.cy.ts index f02e346..50ce839 100644 --- a/apps/testing-router-outlet/src/app/app.component.cy.ts +++ b/apps/testing-router-outlet/src/app/app.component.cy.ts @@ -1,23 +1,33 @@ import { AppComponent } from './app.component'; describe(AppComponent.name, () => { - it('shows error message and disabled button because no search criteria are typed', () => { - //todo + describe('Given no search criteria', () => { + it('Then shows error message and disabled button', () => { + //todo + }); }); - it('shows No book found because no book match the search', () => { - //todo + describe('Given a search criteria with no book match', () => { + it('Then shows No book found', () => { + //todo + }); }); - it('shows One book because the search matches one book', () => { - //todo + describe('Given a search criteria with one book match', () => { + it('Then shows One book and no error', () => { + //todo + }); }); - it('shows One book because the search matches one book even with different cases', () => { - //todo + describe('Given a search criteria in Uppercase with one book match', () => { + it('Then shows One book and no error', () => { + //todo + }); }); - it('shows a list of books because the search matches multiples books', () => { - //todo + describe('Given a search criteria with multple books matches', () => { + it('Then shows a list of books', () => { + //todo + }); }); }); diff --git a/apps/testing-router-outlet/src/app/app.component.spec.ts b/apps/testing-router-outlet/src/app/app.component.spec.ts index c618b12..6cf2f4a 100644 --- a/apps/testing-router-outlet/src/app/app.component.spec.ts +++ b/apps/testing-router-outlet/src/app/app.component.spec.ts @@ -1,21 +1,31 @@ describe('AppComponent', () => { - it('shows error message and disabled button because no search criteria are typed', async () => { - //todo + describe('Given no search criteria', () => { + it('Then shows error message and disabled button', async () => { + //todo + }); }); - it('shows No book found because no book match the search', async () => { - //todo + describe('Given a search criteria with no book match', () => { + it('Then shows No book found', async () => { + //todo + }); }); - it('shows One book because the search matches one book', async () => { - //todo + describe('Given a search criteria with one book match', () => { + it('Then shows One book and no error', async () => { + //todo + }); }); - it('shows One book because the search matches one book even with different cases', async () => { - //todo + describe('Given a search criteria in Uppercase with one book match', () => { + it('Then shows One book and no error', async () => { + //todo + }); }); - it('shows a list of books because the search matches multiples books', async () => { - //todo + describe('Given a search criteria with multple books matches', () => { + it('Then shows a list of books', async () => { + //todo + }); }); }); diff --git a/apps/testing-router-outlet/src/app/app.routes.ts b/apps/testing-router-outlet/src/app/app.routes.ts index e4e15aa..9276314 100644 --- a/apps/testing-router-outlet/src/app/app.routes.ts +++ b/apps/testing-router-outlet/src/app/app.routes.ts @@ -2,6 +2,11 @@ import { ActivatedRouteSnapshot, Route } from '@angular/router'; import { bookGuard } from './book.guard'; export const appRoutes: Route[] = [ + { + path: '', + pathMatch: 'full', + redirectTo: 'search', + }, { path: 'search', loadComponent: () => import('./search.component'), @@ -15,4 +20,9 @@ export const appRoutes: Route[] = [ path: 'no-result', loadComponent: () => import('./no-book-search.component'), }, + { + path: '**', + pathMatch: 'full', + redirectTo: 'search', + }, ];