Skip to content

Commit b0c7120

Browse files
author
Nicolas Laplante
committed
update specs to test the deep merged translations
1 parent 3052a61 commit b0c7120

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

projects/ngx-translate/multi-http-loader/tests/multi-http-loader.spec.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,17 @@ describe('MultiTranslateHttpLoader - Multiple Translation Files', () => {
151151
// mock response after the xhr request, otherwise it will be undefined
152152
http.expectOne('/assets/i18n/core/en.json').flush({
153153
"TEST": "This is a test (core)",
154-
"TEST2": "This is another test (core)"
154+
"TEST2": "This is another test (core)",
155+
"DEEP": {
156+
"some": "thing"
157+
}
155158
});
156159
http.expectOne('/assets/i18n/shared/en.json').flush({
157160
"TEST-SHARED": "This is a test (shared)",
158-
"TEST2-SHARED": "This is another test (shared)"
161+
"TEST2-SHARED": "This is another test (shared)",
162+
"DEEP": {
163+
"another": "something"
164+
}
159165
});
160166

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

0 commit comments

Comments
 (0)