-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(trim): Fixed boolean option condition and add tests
- Loading branch information
1 parent
aad6e96
commit 8432f28
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
projects/ngx-translate-cut/src/lib/ngx-translate-cut.options.factory.spec.ts
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,29 @@ | ||
import { SEPARATOR } from './ngx-translate-cut.constants'; | ||
import { ngxTranslateCutOptionsFactory } from './ngx-translate-cut.options.factory'; | ||
import { NgxTranslateCutOptions } from './ngx-translate-cut.options.interface'; | ||
import { NgxTranslateCutOptionsService } from './ngx-translate-cut.options.service'; | ||
|
||
describe('ngxTranslateCutOptionsFactory', () => { | ||
let factory: (options?: NgxTranslateCutOptions) => NgxTranslateCutOptionsService; | ||
|
||
beforeEach(() => { | ||
factory = ngxTranslateCutOptionsFactory; | ||
}); | ||
|
||
it('should be created with default options', () => { | ||
const result = factory(); | ||
|
||
expect(result.separator).toEqual(SEPARATOR); | ||
expect(result.trim).toEqual(true); | ||
}); | ||
|
||
it('should be created with custom options', () => { | ||
const result = factory({ | ||
separator: '*', | ||
trim: false, | ||
}); | ||
|
||
expect(result.separator).toEqual('*'); | ||
expect(result.trim).toEqual(false); | ||
}); | ||
}); |
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