This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6abba76
commit 971a677
Showing
6 changed files
with
435 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { async, TestBed } from '@angular/core/testing'; | ||
import { By } from '@angular/platform-browser'; | ||
import { SpaceNamePipe } from './space-name.pipe' | ||
|
||
describe('Pipe used for Name Space', () => { | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [SpaceNamePipe] | ||
}); | ||
}); | ||
|
||
it('Replace first underscore with space', async(() => { | ||
// given | ||
let fixture = new SpaceNamePipe(); | ||
// when | ||
let spaceNameTansformed = fixture.transform('a_test_with_space'); | ||
// then | ||
expect(spaceNameTansformed).toEqual('a test with space'); | ||
})); | ||
|
||
it('Do not fail with undefined/nil value', async(() => { | ||
// given | ||
let fixture = new SpaceNamePipe(); | ||
// when | ||
let spaceNameTansformed = fixture.transform(undefined); | ||
// then | ||
expect(spaceNameTansformed).toEqual(undefined); | ||
})); | ||
}); |
Oops, something went wrong.