Skip to content

Commit ddfe78c

Browse files
committed
fixed tests
1 parent dbe870b commit ddfe78c

27 files changed

Lines changed: 212 additions & 174 deletions

.github/workflows/run-tests.yaml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ jobs:
3131
env: {}
3232
- package: pgpm/cli
3333
env: {}
34-
# - package: packages/cli
35-
# env: {}
36-
# # test failures: prompt/generate call
37-
# - package: jobs/knative-job-service
38-
# env: {}
39-
# # needs Knative infra
34+
- package: packages/cli
35+
env: {}
36+
- package: jobs/knative-job-service
37+
env: {}
4038
- package: packages/client
4139
env:
4240
TEST_DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
@@ -52,9 +50,8 @@ jobs:
5250
env: {}
5351
- package: uploads/uuid-stream
5452
env: {}
55-
# - package: postgres/introspectron
56-
# env: {}
57-
# # GraphQL v15/v16 type mismatch
53+
- package: postgres/introspectron
54+
env: {}
5855
- package: packages/query-builder
5956
env: {}
6057
- package: graphql/query
@@ -67,17 +64,19 @@ jobs:
6764
env: {}
6865
- package: uploads/content-type-stream
6966
env: {}
70-
# - package: uploads/s3-streamer
71-
# env:
72-
# BUCKET_NAME: test-bucket
73-
# # needs MinIO bucket setup
67+
- package: uploads/s3-streamer
68+
env:
69+
BUCKET_NAME: test-bucket
7470
- package: uploads/upload-names
7571
env: {}
76-
# - package: graphile/graphile-test
77-
# env: {}
78-
# # typed mutation test failures
72+
- package: graphile/graphile-test
73+
env: {}
7974
- package: graphile/graphile-search-plugin
8075
env: {}
76+
- package: graphile/graphile-authz
77+
env: {}
78+
- package: graphile/postgraphile-plugin-pgvector
79+
env: {}
8180
- package: graphql/server-test
8281
env: {}
8382
- package: graphql/env
@@ -86,16 +85,10 @@ jobs:
8685
env: {}
8786
- package: graphql/test
8887
env: {}
89-
- package: graphile/graphile-authz
90-
env: {}
91-
- package: graphile/postgraphile-plugin-pgvector
88+
- package: graphql/playwright-test
9289
env: {}
93-
# - package: graphql/playwright-test
94-
# env: {}
95-
# # needs browser infra
9690
# - package: jobs/knative-job-worker
9791
# env: {}
98-
# # needs Knative infra
9992
- package: packages/csv-to-pg
10093
env: {}
10194
- package: packages/smtppostmaster

functions/send-email-link/src/index.ts

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,39 @@ const app = createJobApp();
1414

1515
const GetUser = gql`
1616
query GetUser($userId: UUID!) {
17-
user(id: $userId) {
18-
username
19-
displayName
20-
profilePicture
17+
users(condition: { id: $userId }, first: 1) {
18+
nodes {
19+
username
20+
displayName
21+
profilePicture
22+
}
2123
}
2224
}
2325
`;
2426

2527
const GetDatabaseInfo = gql`
2628
query GetDatabaseInfo($databaseId: UUID!) {
27-
database(id: $databaseId) {
28-
sites {
29-
nodes {
30-
domains {
31-
nodes {
32-
subdomain
33-
domain
29+
databases(condition: { id: $databaseId }, first: 1) {
30+
nodes {
31+
sites {
32+
nodes {
33+
domains {
34+
nodes {
35+
subdomain
36+
domain
37+
}
3438
}
35-
}
36-
logo
37-
title
38-
siteThemes {
39-
nodes {
40-
theme
39+
logo
40+
title
41+
siteThemes {
42+
nodes {
43+
theme
44+
}
4145
}
42-
}
43-
siteModules(condition: { name: "legal_terms_module" }) {
44-
nodes {
45-
data
46+
siteModules(condition: { name: "legal_terms_module" }) {
47+
nodes {
48+
data
49+
}
4650
}
4751
}
4852
}
@@ -165,7 +169,8 @@ export const sendEmailLink = async (
165169
databaseId
166170
});
167171

168-
const site = databaseInfo?.database?.sites?.nodes?.[0];
172+
const database = databaseInfo?.databases?.nodes?.[0];
173+
const site = database?.sites?.nodes?.[0];
169174
if (!site) {
170175
throw new Error('Site not found for database');
171176
}
@@ -244,7 +249,7 @@ export const sendEmailLink = async (
244249
const inviter = await client.request<any>(GetUser, {
245250
userId: params.sender_id
246251
});
247-
inviterName = inviter?.user?.displayName;
252+
inviterName = inviter?.users?.nodes?.[0]?.displayName;
248253

249254
if (inviterName) {
250255
subject = `${inviterName} invited you to ${nick}!`;

graphile/graphile-search-plugin/__tests__/__snapshots__/plugin.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`PgSearchPlugin condition-based search on stsv column returns only title
66
"nodes": [
77
{
88
"description": "Second in years female given. Us firmament. She'd kind there let moved thing evening saying set whales a fowl heaven.",
9-
"rowId": 6,
9+
"rowId": "[ID]",
1010
"title": "green fowl",
1111
},
1212
],
@@ -20,17 +20,17 @@ exports[`PgSearchPlugin condition-based search on tsv column returns matching ro
2020
"nodes": [
2121
{
2222
"description": "Appear evening that gathered saying. Sea subdue so fill stars. Bring is man divided behold fish their. Also won't fowl.",
23-
"rowId": 2,
23+
"rowId": "[ID]",
2424
"title": "evenings",
2525
},
2626
{
2727
"description": "Heaven. Tree creeping was. Gathered living dominion us likeness first subdue fill. Fowl him moveth fly also the is created.",
28-
"rowId": 3,
28+
"rowId": "[ID]",
2929
"title": "heaven",
3030
},
3131
{
3232
"description": "Second in years female given. Us firmament. She'd kind there let moved thing evening saying set whales a fowl heaven.",
33-
"rowId": 6,
33+
"rowId": "[ID]",
3434
"title": "green fowl",
3535
},
3636
],

graphile/graphile-test/__tests__/__snapshots__/graphile-test.graphile-tx.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ exports[`handles duplicate insert via internal PostGraphile savepoint: firstInse
2727
"data": {
2828
"createUser": {
2929
"user": {
30-
"id": "[ID]",
30+
"rowId": "[ID]",
3131
"username": "dupeuser",
3232
},
3333
},
@@ -41,7 +41,7 @@ exports[`handles duplicate insert via internal PostGraphile savepoint: queryAfte
4141
"allUsers": {
4242
"nodes": [
4343
{
44-
"id": "[ID]",
44+
"rowId": "[ID]",
4545
"username": "dupeuser",
4646
},
4747
],

graphile/graphile-test/__tests__/__snapshots__/graphile-test.graphql.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`creates a user and fetches it: createUser 1`] = `
55
"data": {
66
"createUser": {
77
"user": {
8-
"id": "[ID]",
8+
"rowId": "[ID]",
99
"username": "testuser1",
1010
},
1111
},

graphile/graphile-test/__tests__/__snapshots__/graphile-test.roles.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`creates a user and fetches it: createUser 1`] = `
55
"data": {
66
"createUser": {
77
"user": {
8-
"id": "[ID]",
8+
"rowId": "[ID]",
99
"username": "testuser1",
1010
},
1111
},

graphile/graphile-test/__tests__/__snapshots__/graphile-test.types.positional.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`creates a user and returns typed result: create-user 1`] = `
44
{
55
"createUser": {
66
"user": {
7-
"id": "[ID]",
7+
"rowId": "[ID]",
88
"username": "alice",
99
},
1010
},

graphile/graphile-test/__tests__/__snapshots__/graphile-test.types.positional.unwrapped.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`creates a user and returns typed result: create-user 1`] = `
44
{
55
"createUser": {
66
"user": {
7-
"id": "[ID]",
7+
"rowId": "[ID]",
88
"username": "alice",
99
},
1010
},

graphile/graphile-test/__tests__/__snapshots__/graphile-test.types.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`creates a user and returns typed result: create-user 1`] = `
55
"data": {
66
"createUser": {
77
"user": {
8-
"id": "[ID]",
8+
"rowId": "[ID]",
99
"username": "alice",
1010
},
1111
},

graphile/graphile-test/__tests__/__snapshots__/graphile-test.types.unwrapped.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`creates a user and returns typed result: create-user 1`] = `
44
{
55
"createUser": {
66
"user": {
7-
"id": "[ID]",
7+
"rowId": "[ID]",
88
"username": "alice",
99
},
1010
},

0 commit comments

Comments
 (0)