From 24fb56866fd438f9e89acd9d542a9a7286a8ca73 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 31 Mar 2023 06:59:20 +0530 Subject: [PATCH] test: webhook fix for mysql & sqlite Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/tests/01-webhook.spec.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/playwright/tests/01-webhook.spec.ts b/tests/playwright/tests/01-webhook.spec.ts index 415b21bbd0..325bde44bb 100644 --- a/tests/playwright/tests/01-webhook.spec.ts +++ b/tests/playwright/tests/01-webhook.spec.ts @@ -5,6 +5,7 @@ import makeServer from '../setup/server'; import { WebhookFormPage } from '../pages/Dashboard/WebhookForm'; import { isSubset } from './utils/general'; import { Api, UITypes } from 'nocodb-sdk'; +import { isMysql, isPg, isSqlite } from '../setup/db'; const hookPath = 'http://localhost:9090/hook'; let api: Api; @@ -714,6 +715,28 @@ test.describe.serial('Webhook', () => { }, }; + if (isSqlite(context) || isMysql(context)) { + // @ts-ignore + expectedData.data.previous_rows[0].CountryCode = 1; + // @ts-ignore + expectedData.data.rows[0].CountryCode = 1; + // @ts-ignore + expectedData.data.previous_rows[0].CityCodeRollup = 2; + // @ts-ignore + expectedData.data.rows[0].CityCodeRollup = 2; + // @ts-ignore + expectedData.data.previous_rows[0].CityCodeLookup = [23, 33]; + // @ts-ignore + expectedData.data.rows[0].CityCodeLookup = [23, 33]; + + if (isMysql(context)) { + // @ts-ignore + expectedData.data.previous_rows[0].CityCodeFormula = '100'; + // @ts-ignore + expectedData.data.rows[0].CityCodeFormula = '100'; + } + } + await expect(isSubset(rsp[0], expectedData)).toBe(true); }); });