From 0fbf89f0397169461f041ab522a476f8042993ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20V=C3=A1clavek?= <49518842+david-vaclavek@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:39:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20numeric=20value=20in=20t?= =?UTF-8?q?he=20import=20JSON=20structure=20(#15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: david-vaclavek --- tests/specs/import.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/specs/import.spec.ts b/tests/specs/import.spec.ts index ac6c615..2c31e08 100644 --- a/tests/specs/import.spec.ts +++ b/tests/specs/import.spec.ts @@ -15,13 +15,14 @@ describe('Import', (): void => { }); test('api.import.json', async (): Promise => { - const json: I18nJson = { en: { headers: { person: 'Active person' } } }; + const json: I18nJson = { en: { headers: { person: 'Active person' }, 99: { luft: 'baloons' } } }; const request: ImportJsonRequest = { project, json, fileOptions: { name: 'en.json' } }; const spy: MockInstance = vi.spyOn(globalThis, 'fetch'); await api.import.json(request); expect(spy).toHaveBeenCalledWith('https://api.localazy.com/projects/_a0000000000000000001/import', { - body: '{"files":[{"name":"en.json","content":{"type":"json","en":{"headers":{"person":"Active person"}}}}]}', + // eslint-disable-next-line max-len + body: '{"files":[{"name":"en.json","content":{"type":"json","en":{"99":{"luft":"baloons"},"headers":{"person":"Active person"}}}}]}', headers: { Accept: 'application/json', Authorization: `Bearer ${getToken()}`,