From c15aafe6a2cbd2f68ccb43cca6fd7299ed57440f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 27 Oct 2021 13:33:11 +0100 Subject: [PATCH] Fixing builder jest tests. --- .../stores/backend/tests/datasources.spec.js | 2 +- .../backend/tests/fixtures/datasources.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/stores/backend/tests/datasources.spec.js b/packages/builder/src/stores/backend/tests/datasources.spec.js index fb175f03b9..46e9568b50 100644 --- a/packages/builder/src/stores/backend/tests/datasources.spec.js +++ b/packages/builder/src/stores/backend/tests/datasources.spec.js @@ -53,7 +53,7 @@ describe("Datasources Store", () => { }) - expect(get(store).list).toEqual(expect.arrayContaining([SAVE_DATASOURCE])) + expect(get(store).list).toEqual(expect.arrayContaining([SAVE_DATASOURCE.datasource])) }) it("deletes a datasource, updates the store and returns status message", async () => { api.get.mockReturnValue({ json: () => SOME_DATASOURCE}) diff --git a/packages/builder/src/stores/backend/tests/fixtures/datasources.js b/packages/builder/src/stores/backend/tests/fixtures/datasources.js index 550b662787..933fe157ad 100644 --- a/packages/builder/src/stores/backend/tests/fixtures/datasources.js +++ b/packages/builder/src/stores/backend/tests/fixtures/datasources.js @@ -13,13 +13,15 @@ export const SOME_DATASOURCE = [ ] export const SAVE_DATASOURCE = { - type: "datasource", - name: "CoolDB", - source: "REST", - config: { - url: "localhost", - defaultHeaders: {}, + datasource: { + type: "datasource", + name: "CoolDB", + source: "REST", + config: { + url: "localhost", + defaultHeaders: {}, + }, + _id: "datasource_04b003a7b4a8428eadd3bb2f7eae0255", + _rev: "1-4e72002f1011e9392e655948469b7908", }, - _id: "datasource_04b003a7b4a8428eadd3bb2f7eae0255", - _rev: "1-4e72002f1011e9392e655948469b7908", }