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

Remove ngx-translate-testing from project

parent 3c292683
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
import { ValidPagesPipe } from './valid-pages.pipe';
import { TestBed } from '@angular/core/testing';
import { TranslateService } from '@ngx-translate/core';
import { TranslateTestingModule } from 'ngx-translate-testing';
import { Page } from 'common/models/page';
describe('ValidPagesPipe', () => {
let pipe: ValidPagesPipe;
let translateService: TranslateService;
const TRANSLATIONS = {
de: {
'pageIndication': 'Seite {{index}}'
}
};
const page = new Page({
hasMaxWidth: false,
maxWidth: 0,
margin: 0,
backgroundColor: 'white',
alwaysVisible: false,
alwaysVisiblePagePosition: 'left',
alwaysVisibleAspectRatio: 50,
sections: []
});
beforeEach(() => {
TestBed
.configureTestingModule({
imports: [TranslateTestingModule.withTranslations(TRANSLATIONS).withDefaultLanguage('de')]
});
translateService = TestBed.inject(TranslateService);
pipe = new ValidPagesPipe(translateService);
});
it('should create', () => {
expect(pipe).toBeTruthy();
});
it('should transform 1 valid page', () => {
const pages = [page];
expect(pipe.transform(pages)).toEqual({ '0': 'Seite 1' });
});
it('should transform 3 valid pages', () => {
const pages = [page, page, page];
expect(pipe.transform(pages)).toEqual({ '0': 'Seite 1', '1': 'Seite 2', '2': 'Seite 3' });
});
it('should transform an empty pages array to an empty object', () => {
const pages: Page[] = [];
expect(pipe.transform(pages)).toEqual({ });
});
});
// import { ValidPagesPipe } from './valid-pages.pipe';
// import { TestBed } from '@angular/core/testing';
// import { TranslateService } from '@ngx-translate/core';
// import { TranslateTestingModule } from 'ngx-translate-testing';
// import { Page } from 'common/models/page';
//
// describe('ValidPagesPipe', () => {
// let pipe: ValidPagesPipe;
// let translateService: TranslateService;
// const TRANSLATIONS = {
// de: {
// 'pageIndication': 'Seite {{index}}'
// }
// };
//
// const page = new Page({
// hasMaxWidth: false,
// maxWidth: 0,
// margin: 0,
// backgroundColor: 'white',
// alwaysVisible: false,
// alwaysVisiblePagePosition: 'left',
// alwaysVisibleAspectRatio: 50,
// sections: []
// });
//
// beforeEach(() => {
// TestBed
// .configureTestingModule({
// imports: [TranslateTestingModule.withTranslations(TRANSLATIONS).withDefaultLanguage('de')]
// });
// translateService = TestBed.inject(TranslateService);
// pipe = new ValidPagesPipe(translateService);
// });
//
// it('should create', () => {
// expect(pipe).toBeTruthy();
// });
//
// it('should transform 1 valid page', () => {
// const pages = [page];
// expect(pipe.transform(pages)).toEqual({ '0': 'Seite 1' });
// });
//
// it('should transform 3 valid pages', () => {
// const pages = [page, page, page];
// expect(pipe.transform(pages)).toEqual({ '0': 'Seite 1', '1': 'Seite 2', '2': 'Seite 3' });
// });
//
// it('should transform an empty pages array to an empty object', () => {
// const pages: Page[] = [];
// expect(pipe.transform(pages)).toEqual({ });
// });
//
// });
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