Skip to content

Commit d15c870

Browse files
authored
fix: fix db tests (#5473)
## Description 1. What is this PR about (link the issue and add a short description) ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent cc20991 commit d15c870

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pnpm-lock.yaml
22
packages/prisma-client/prisma/migrations/*/client
33
packages/prisma-client/**/*.d.ts
4+
packages/postgrest/supabase/tests/*.sql

packages/postgrest/supabase/tests/latest-builds-domains.sql

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ORDER BY
137137
SELECT
138138
results_eq(
139139
'SELECT * FROM "public"."TestProjectDomains" WHERE "projectId" = ''project1''',
140-
$ $
140+
$$
141141
SELECT
142142
*
143143
FROM
@@ -147,7 +147,7 @@ SELECT
147147
('project1', 'project-1-custom-domain-2', NULL)
148148
) AS expected(projectId, domainId, buildId)
149149
ORDER BY
150-
domainId $ $,
150+
domainId $$,
151151
'Initial state without builds'
152152
);
153153

@@ -179,7 +179,7 @@ VALUES
179179
SELECT
180180
results_eq(
181181
'SELECT * FROM "public"."TestProjectDomains" WHERE "projectId" = ''project1''',
182-
$ $
182+
$$
183183
SELECT
184184
*
185185
FROM
@@ -193,7 +193,7 @@ SELECT
193193
('project1', 'project-1-custom-domain-2', NULL)
194194
) AS expected(projectId, domainId, buildId)
195195
ORDER BY
196-
domainId $ $,
196+
domainId $$,
197197
'After inserting build1 associated with custom domain 1'
198198
);
199199

@@ -225,7 +225,7 @@ VALUES
225225
SELECT
226226
results_eq(
227227
'SELECT * FROM "public"."TestProjectDomains" WHERE "projectId" = ''project1''',
228-
$ $
228+
$$
229229
SELECT
230230
*
231231
FROM
@@ -239,7 +239,7 @@ SELECT
239239
('project1', 'project-1-custom-domain-2', NULL)
240240
) AS expected(projectId, domainId, buildId)
241241
ORDER BY
242-
domainId $ $,
242+
domainId $$,
243243
'After inserting build2 associated with custom domain 1'
244244
);
245245

@@ -271,7 +271,7 @@ VALUES
271271
SELECT
272272
results_eq(
273273
'SELECT * FROM "public"."TestProjectDomains" WHERE "projectId" = ''project1''',
274-
$ $
274+
$$
275275
SELECT
276276
*
277277
FROM
@@ -289,7 +289,7 @@ SELECT
289289
)
290290
) AS expected(projectId, domainId, buildId)
291291
ORDER BY
292-
domainId $ $,
292+
domainId $$,
293293
'After inserting build3 associated with custom domain 2'
294294
);
295295

@@ -321,7 +321,7 @@ VALUES
321321
SELECT
322322
results_eq(
323323
'SELECT * FROM "public"."TestProjectDomains" WHERE "projectId" = ''project1''',
324-
$ $
324+
$$
325325
SELECT
326326
*
327327
FROM
@@ -339,7 +339,7 @@ SELECT
339339
)
340340
) AS expected(projectId, domainId, buildId)
341341
ORDER BY
342-
domainId $ $,
342+
domainId $$,
343343
'After inserting build4 associated with both domains'
344344
);
345345

@@ -399,7 +399,7 @@ VALUES
399399
SELECT
400400
results_eq(
401401
'SELECT * FROM "public"."TestProjectDomains" WHERE "projectId" = ''project1''',
402-
$ $
402+
$$
403403
SELECT
404404
*
405405
FROM
@@ -417,7 +417,7 @@ SELECT
417417
)
418418
) AS expected(projectId, domainId, buildId)
419419
ORDER BY
420-
domainId $ $,
420+
domainId $$,
421421
'Verify Project1 results remain unchanged after Project2 updates'
422422
);
423423

@@ -426,14 +426,14 @@ SELECT
426426
--------------------------------------------------------------------------------
427427
SELECT
428428
results_eq(
429-
$ $
429+
$$
430430
SELECT
431431
*
432432
FROM
433433
"public"."TestProjectDomains"
434434
WHERE
435-
"projectId" = 'project2' $ $,
436-
$ $
435+
"projectId" = 'project2' $$,
436+
$$
437437
SELECT
438438
*
439439
FROM
@@ -451,7 +451,7 @@ SELECT
451451
)
452452
) AS expected(projectId, domainId, buildId)
453453
ORDER BY
454-
domainId $ $,
454+
domainId $$,
455455
'Verify Project2 results reflect the latest build'
456456
);
457457

packages/postgrest/supabase/tests/latest-builds-projects.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,22 +782,22 @@ SELECT
782782
-- Verify column names match expected structure
783783
SELECT
784784
bag_eq(
785-
$ $
785+
$$
786786
SELECT
787787
column_name :: text
788788
FROM
789789
information_schema.columns
790790
WHERE
791-
table_name = 'latestBuildVirtual' $ $,
792-
$ $
791+
table_name = 'latestBuildVirtual' $$,
792+
$$
793793
VALUES
794794
('buildId'),
795795
('projectId'),
796796
('domainsVirtualId'),
797797
('domain'),
798798
('createdAt'),
799799
('publishStatus'),
800-
('updatedAt') $ $,
800+
('updatedAt') $$,
801801
'Test Case 10.1: All expected columns should be present in latestBuildVirtual table.'
802802
);
803803

0 commit comments

Comments
 (0)