Skip to content

Commit

Permalink
update specs to test the deep merged translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Laplante committed Sep 13, 2018
1 parent 3052a61 commit b0c7120
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,17 @@ describe('MultiTranslateHttpLoader - Multiple Translation Files', () => {
// mock response after the xhr request, otherwise it will be undefined
http.expectOne('/assets/i18n/core/en.json').flush({
"TEST": "This is a test (core)",
"TEST2": "This is another test (core)"
"TEST2": "This is another test (core)",
"DEEP": {
"some": "thing"
}
});
http.expectOne('/assets/i18n/shared/en.json').flush({
"TEST-SHARED": "This is a test (shared)",
"TEST2-SHARED": "This is another test (shared)"
"TEST2-SHARED": "This is another test (shared)",
"DEEP": {
"another": "something"
}
});

// this will request the translation from downloaded translations without making a request to the backend
Expand All @@ -165,5 +171,11 @@ describe('MultiTranslateHttpLoader - Multiple Translation Files', () => {
translate.get('TEST2-SHARED').subscribe((res: string) => {
expect(res).toEqual('This is another test (shared)');
});
translate.get('DEEP').subscribe((res: any) => {
expect(res).toEqual({
"some": "thing",
"another": "something"
});
});
});
});

0 comments on commit b0c7120

Please sign in to comment.