Skip to content
Snippets Groups Projects
Commit e345ce53 authored by jojohoch's avatar jojohoch
Browse files

Reactivate tests for the ScrollPagePipe

parent d8050000
No related branches found
No related tags found
No related merge requests found
Pipeline #43782 passed
import { TestBed } from '@angular/core/testing';
import { SharedModule } from 'common/shared.module';
import { Page } from 'common/models/page';
import { ScrollPagesPipe } from './scroll-pages.pipe';
describe('ScrollPagesPipe', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
SharedModule
]
})
.compileComponents();
});
const page: Page = new Page({
hasMaxWidth: false,
maxWidth: 0,
margin: 0,
backgroundColor: 'white',
alwaysVisible: false,
alwaysVisiblePagePosition: 'left',
alwaysVisibleAspectRatio: 50,
sections: []
});
const pipe = new ScrollPagesPipe();
it('create an instance', () => {
const pipe = new ScrollPagesPipe();
expect(pipe).toBeTruthy();
});
it('should transform 3 pages to 2 scroll pages', () => {
const pages = [page, page, { ...page, alwaysVisible: true } as Page];
expect(pipe.transform(pages).length).toBe(2);
});
it('should transform 2 pages to 2 scroll pages', () => {
const pages = [page, page];
expect(pipe.transform(pages).length).toBe(2);
});
});
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