mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
committed by
Eugenio Romano
parent
53d96679ea
commit
e39a2b149b
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { HighlightTransformService, HightlightTransformResult } from '../services/highlight-transform.service';
|
||||
import { HighlightTransformService, HighlightTransformResult } from '../services/highlight-transform.service';
|
||||
|
||||
@Pipe({
|
||||
name: 'highlight'
|
||||
@@ -26,7 +26,7 @@ export class HighlightPipe implements PipeTransform {
|
||||
constructor(private highlightTransformService: HighlightTransformService) { }
|
||||
|
||||
transform(text: string, search: string): string {
|
||||
const result: HightlightTransformResult = this.highlightTransformService.highlight(text, search);
|
||||
const result: HighlightTransformResult = this.highlightTransformService.highlight(text, search);
|
||||
return result.text;
|
||||
}
|
||||
}
|
||||
|
@@ -46,6 +46,7 @@ describe('TimeAgoPipe', () => {
|
||||
it('should return a localised message', async(() => {
|
||||
let date = new Date();
|
||||
const transformedDate = pipe.transform(date, 'de');
|
||||
/* cspell:disable-next-line */
|
||||
expect(transformedDate).toBe('vor ein paar Sekunden');
|
||||
}));
|
||||
});
|
||||
|
@@ -19,7 +19,7 @@ import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { UserProcessModel } from '../models/user-process.model';
|
||||
import { InitialUsernamePipe } from './user-initial.pipe';
|
||||
|
||||
class FakeSanitazer extends DomSanitizer {
|
||||
class FakeSanitizer extends DomSanitizer {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
@@ -56,7 +56,7 @@ describe('UserInitialPipe', () => {
|
||||
let fakeUser: UserProcessModel;
|
||||
|
||||
beforeEach(() => {
|
||||
pipe = new InitialUsernamePipe(new FakeSanitazer());
|
||||
pipe = new InitialUsernamePipe(new FakeSanitizer());
|
||||
fakeUser = new UserProcessModel();
|
||||
});
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('UserInitialPipe', () => {
|
||||
expect(result).toBe('<div id="user-initials-image" class="fake-class-to-check">FF</div>');
|
||||
});
|
||||
|
||||
it('should return a single letter into div when lastname is undefined', () => {
|
||||
it('should return a single letter into div when lastName is undefined', () => {
|
||||
fakeUser.firstName = 'FAKE-NAME';
|
||||
fakeUser.lastName = undefined;
|
||||
let result = pipe.transform(fakeUser);
|
||||
|
Reference in New Issue
Block a user