mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
refactor(challenge17): change describe block of challenge 17
This commit is contained in:
@@ -1,23 +1,33 @@
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
describe(AppComponent.name, () => {
|
describe(AppComponent.name, () => {
|
||||||
it('shows error message and disabled button because no search criteria are typed', () => {
|
describe('Given no search criteria', () => {
|
||||||
|
it('Then shows error message and disabled button', () => {
|
||||||
//todo
|
//todo
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows No book found because no book match the search', () => {
|
|
||||||
//todo
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows One book because the search matches one book', () => {
|
describe('Given a search criteria with no book match', () => {
|
||||||
|
it('Then shows No book found', () => {
|
||||||
//todo
|
//todo
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows One book because the search matches one book even with different cases', () => {
|
|
||||||
//todo
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows a list of books because the search matches multiples books', () => {
|
describe('Given a search criteria with one book match', () => {
|
||||||
|
it('Then shows One book and no error', () => {
|
||||||
//todo
|
//todo
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Given a search criteria in Uppercase with one book match', () => {
|
||||||
|
it('Then shows One book and no error', () => {
|
||||||
|
//todo
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Given a search criteria with multple books matches', () => {
|
||||||
|
it('Then shows a list of books', () => {
|
||||||
|
//todo
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,21 +1,31 @@
|
|||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
it('shows error message and disabled button because no search criteria are typed', async () => {
|
describe('Given no search criteria', () => {
|
||||||
|
it('Then shows error message and disabled button', async () => {
|
||||||
//todo
|
//todo
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows No book found because no book match the search', async () => {
|
|
||||||
//todo
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows One book because the search matches one book', async () => {
|
describe('Given a search criteria with no book match', () => {
|
||||||
|
it('Then shows No book found', async () => {
|
||||||
//todo
|
//todo
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows One book because the search matches one book even with different cases', async () => {
|
|
||||||
//todo
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows a list of books because the search matches multiples books', async () => {
|
describe('Given a search criteria with one book match', () => {
|
||||||
|
it('Then shows One book and no error', async () => {
|
||||||
//todo
|
//todo
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Given a search criteria in Uppercase with one book match', () => {
|
||||||
|
it('Then shows One book and no error', async () => {
|
||||||
|
//todo
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Given a search criteria with multple books matches', () => {
|
||||||
|
it('Then shows a list of books', async () => {
|
||||||
|
//todo
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ import { ActivatedRouteSnapshot, Route } from '@angular/router';
|
|||||||
import { bookGuard } from './book.guard';
|
import { bookGuard } from './book.guard';
|
||||||
|
|
||||||
export const appRoutes: Route[] = [
|
export const appRoutes: Route[] = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
pathMatch: 'full',
|
||||||
|
redirectTo: 'search',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'search',
|
path: 'search',
|
||||||
loadComponent: () => import('./search.component'),
|
loadComponent: () => import('./search.component'),
|
||||||
@@ -15,4 +20,9 @@ export const appRoutes: Route[] = [
|
|||||||
path: 'no-result',
|
path: 'no-result',
|
||||||
loadComponent: () => import('./no-book-search.component'),
|
loadComponent: () => import('./no-book-search.component'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '**',
|
||||||
|
pathMatch: 'full',
|
||||||
|
redirectTo: 'search',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user