Skip to content
Snippets Groups Projects
Commit 5cd6f095 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Fix tests

parent 9568cb08
Branches
No related tags found
No related merge requests found
Pipeline #
...@@ -13,6 +13,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; ...@@ -13,6 +13,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MockComponent } from 'ng2-mock-component'; import { MockComponent } from 'ng2-mock-component';
import { SuggestionComponent, FilterListComponent } from '..'; import { SuggestionComponent, FilterListComponent } from '..';
import { FilterDetailComponent } from '../filter-list/filter-detail/filter-detail.component'; import { FilterDetailComponent } from '../filter-list/filter-detail/filter-detail.component';
import { PaginatorComponent } from '../../../shared/components/paginator/paginator.component';
describe('MetadataListComponent', () => { describe('MetadataListComponent', () => {
const datasetList = [{ const datasetList = [{
...@@ -70,7 +71,8 @@ describe('MetadataListComponent', () => { ...@@ -70,7 +71,8 @@ describe('MetadataListComponent', () => {
MockComponent({ selector: 'app-sort' }), MockComponent({ selector: 'app-sort' }),
SuggestionComponent, SuggestionComponent,
FilterListComponent, FilterListComponent,
FilterDetailComponent FilterDetailComponent,
PaginatorComponent
], ],
imports: [ imports: [
MatCardModule, MatCardModule,
...@@ -115,7 +117,7 @@ describe('MetadataListComponent', () => { ...@@ -115,7 +117,7 @@ describe('MetadataListComponent', () => {
it('should initialize the page index', () => { it('should initialize the page index', () => {
// When // When
component.ngOnInit(); component.ngOnInit();
expect(component.paginator.pageIndex).toEqual(5); expect(component.paginator.pageIndex).toEqual(6); // Value of the service plus 1
}); });
it('should get list of metadata from service', () => { it('should get list of metadata from service', () => {
...@@ -137,7 +139,7 @@ describe('MetadataListComponent', () => { ...@@ -137,7 +139,7 @@ describe('MetadataListComponent', () => {
it('should initialize the page index from service', () => { it('should initialize the page index from service', () => {
// When // When
component.search(); component.search();
expect(component.paginator.pageIndex).toEqual(2); expect(component.paginator.pageIndex).toEqual(3); // Value of the service plus 1
}); });
it('should initialize the page size from service', () => { it('should initialize the page size from service', () => {
...@@ -149,7 +151,7 @@ describe('MetadataListComponent', () => { ...@@ -149,7 +151,7 @@ describe('MetadataListComponent', () => {
it('should get count of metadata from service', () => { it('should get count of metadata from service', () => {
// When // When
component.search(); component.search();
expect(component.metadata_total).toBe(10); expect(component.paginator.length).toBe(10);
}); });
it('should get the list of metadata from service', () => { it('should get the list of metadata from service', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment