Compare commits

...

63 Commits

Author SHA1 Message Date
7e31629de6 Merge pull request 'Add a button to download a PDF file with all QR codes' (#306) from invitations-download-pdf into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 54s
Playwright Tests / test (push) Successful in 4m15s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m54s
Reviewed-on: #306
2025-07-01 15:54:30 +00:00
b4ec903ce0 Add a button to download a PDF file with all QR codes
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 29s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m34s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m17s
Playwright Tests / test (pull_request) Successful in 4m18s
2025-07-01 17:49:49 +02:00
d390d6e055 Merge pull request 'Update dependency node to v24.3.0' (#300) from renovate/node-24.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 43s
Playwright Tests / test (push) Successful in 5m12s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m31s
Reviewed-on: #300
2025-06-30 15:47:28 +00:00
Renovate Bot
f4e49d2594 Update dependency node to v24.3.0
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 8m31s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m20s
Build Nginx-based docker image / build-static-assets (push) Successful in 1h5m37s
Playwright Tests / test (pull_request) Successful in 58m48s
2025-06-30 02:06:50 +00:00
Renovate Bot
140650d682 Update dependency next-auth to v5.0.0-beta.29
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 4m11s
Playwright Tests / test (push) Successful in 19m33s
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m7s
Add copyright notice / copyright_notice (pull_request) Successful in 7m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 29m53s
Playwright Tests / test (pull_request) Successful in 18m56s
2025-06-29 02:04:57 +00:00
Renovate Bot
c239f81e8b Update dependency @atlaskit/pragmatic-drag-and-drop to v1.7.4
All checks were successful
Build Nginx-based docker image / build-static-assets (push) Successful in 38m37s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m39s
Add copyright notice / copyright_notice (pull_request) Successful in 2m41s
Playwright Tests / test (pull_request) Successful in 20m17s
Check usage of free licenses / build-static-assets (push) Successful in 4m0s
Playwright Tests / test (push) Successful in 18m22s
2025-06-28 02:03:55 +00:00
1e52f68d16 Merge pull request 'Update dependency @tiptap/pm to v2.23.0' (#302) from renovate/tiptap-pm-2.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 54s
Playwright Tests / test (push) Successful in 6m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 8m56s
Reviewed-on: #302
2025-06-27 06:44:21 +00:00
Renovate Bot
7ee0502a66 Update dependency @tiptap/pm to v2.23.0
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m44s
Add copyright notice / copyright_notice (pull_request) Successful in 2m12s
Build Nginx-based docker image / build-static-assets (push) Successful in 46m44s
Playwright Tests / test (pull_request) Successful in 52m0s
2025-06-27 02:07:15 +00:00
Renovate Bot
f3af4ade2b Update pnpm to v10.12.3
Some checks failed
Playwright Tests / test (push) Failing after 50m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 1h12m32s
Playwright Tests / test (pull_request) Successful in 28m38s
Check usage of free licenses / build-static-assets (push) Successful in 4m50s
Check usage of free licenses / build-static-assets (pull_request) Successful in 7m2s
Add copyright notice / copyright_notice (pull_request) Successful in 7m17s
2025-06-25 02:05:37 +00:00
Renovate Bot
0788f7c6e4 Update dependency @tiptap/react to v2.22.3
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 4m18s
Playwright Tests / test (push) Successful in 17m12s
Build Nginx-based docker image / build-static-assets (push) Successful in 18m55s
Add copyright notice / copyright_notice (pull_request) Successful in 2m28s
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m9s
Playwright Tests / test (pull_request) Successful in 33m8s
2025-06-23 02:07:12 +00:00
203887da10 Merge pull request 'Update dependency zod to v3.25.67' (#289) from renovate/zod-3.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m16s
Playwright Tests / test (push) Successful in 4m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m28s
Reviewed-on: #289
2025-06-22 08:55:25 +00:00
fc7bb9729d Merge pull request 'Update dependency @tiptap/pm to v2.22.3' (#292) from renovate/tiptap-pm-2.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #292
2025-06-22 08:55:19 +00:00
Renovate Bot
d354c15e64 Update dependency @tiptap/pm to v2.22.3
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m44s
Add copyright notice / copyright_notice (pull_request) Successful in 2m47s
Playwright Tests / test (pull_request) Successful in 39m17s
Build Nginx-based docker image / build-static-assets (push) Successful in 52m56s
2025-06-22 02:07:23 +00:00
Renovate Bot
79e4998e3c Update dependency zod to v3.25.67
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m34s
Add copyright notice / copyright_notice (pull_request) Successful in 2m49s
Build Nginx-based docker image / build-static-assets (push) Successful in 39m48s
Playwright Tests / test (pull_request) Successful in 40m34s
2025-06-22 02:07:11 +00:00
Renovate Bot
07e89b4717 Update dependency @atlaskit/pragmatic-drag-and-drop to v1.7.3
Some checks failed
Add copyright notice / copyright_notice (pull_request) Successful in 1m49s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m2s
Playwright Tests / test (pull_request) Successful in 39m15s
Check usage of free licenses / build-static-assets (push) Successful in 1m34s
Playwright Tests / test (push) Failing after 40m27s
Build Nginx-based docker image / build-static-assets (push) Successful in 58m2s
2025-06-21 02:06:39 +00:00
4c52444110 Merge pull request 'Update dependency @playwright/test to v1.53.1' (#290) from renovate/playwright-test-1.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m32s
Playwright Tests / test (push) Successful in 6m25s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m47s
Reviewed-on: #290
2025-06-20 09:12:56 +00:00
cb51fbddd7 Merge pull request 'Update dependency @tiptap/react to v2.14.1' (#293) from renovate/tiptap-react-2.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #293
2025-06-20 09:12:46 +00:00
Renovate Bot
dcd61a0f38 Update dependency @tiptap/react to v2.14.1
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m16s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 28m24s
Playwright Tests / test (pull_request) Successful in 35m45s
2025-06-20 02:06:59 +00:00
Renovate Bot
4e908ba62a Update dependency @playwright/test to v1.53.1
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m29s
Add copyright notice / copyright_notice (pull_request) Successful in 2m27s
Build Nginx-based docker image / build-static-assets (push) Successful in 27m52s
Playwright Tests / test (pull_request) Successful in 32m21s
2025-06-20 02:06:48 +00:00
b8ecc6de98 Merge pull request 'Update dependency next to v15.3.4' (#291) from renovate/next-15.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 56s
Playwright Tests / test (push) Successful in 7m16s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m35s
Reviewed-on: #291
2025-06-19 06:59:27 +00:00
Renovate Bot
3338dcb604 Update dependency next to v15.3.4
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m30s
Add copyright notice / copyright_notice (pull_request) Successful in 4m31s
Playwright Tests / test (pull_request) Successful in 30m41s
Build Nginx-based docker image / build-static-assets (push) Successful in 36m59s
2025-06-19 02:07:50 +00:00
e09a6892cc Merge pull request 'Improve groups specs and add confirmation dialog to delete action' (#288) from groups-specs into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 39s
Playwright Tests / test (push) Successful in 4m16s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m38s
Reviewed-on: #288
2025-06-17 18:45:56 +00:00
bcc86f2c3b Add specs when group is deleted (+ add confirmation dialog)
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m9s
Add copyright notice / copyright_notice (pull_request) Successful in 1m33s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m29s
Playwright Tests / test (pull_request) Successful in 4m40s
2025-06-17 20:39:40 +02:00
1b957879d4 Add specs for group update operation 2025-06-17 20:35:50 +02:00
536f74cd7a Merge pull request 'Update dependency @types/node to v24.0.3' (#286) from renovate/node-24.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m7s
Playwright Tests / test (push) Successful in 6m48s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m34s
Reviewed-on: #286
2025-06-17 17:15:54 +00:00
2399f6238c Merge pull request 'Update dependency postcss to v8.5.6' (#287) from renovate/postcss-8.x into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Has been cancelled
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #287
2025-06-17 17:15:39 +00:00
Renovate Bot
5d2c43cfef Update dependency postcss to v8.5.6
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 6m3s
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m24s
Build Nginx-based docker image / build-static-assets (push) Successful in 16m33s
Playwright Tests / test (pull_request) Successful in 11m1s
2025-06-17 02:04:30 +00:00
Renovate Bot
2055c95c82 Update dependency @types/node to v24.0.3
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 5m3s
Add copyright notice / copyright_notice (pull_request) Successful in 6m14s
Build Nginx-based docker image / build-static-assets (push) Successful in 16m45s
Playwright Tests / test (pull_request) Successful in 17m23s
2025-06-17 02:04:23 +00:00
71a976eced Merge pull request 'Update node Docker tag to v24' (#249) from renovate/node-24.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 31s
Playwright Tests / test (push) Successful in 4m22s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m20s
Reviewed-on: #249
2025-06-15 13:37:43 +00:00
41bd2ad2b5 Fix CI to use the node versino defined in .nvmrc
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 4m27s
Add copyright notice / copyright_notice (pull_request) Successful in 4m37s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m2s
Playwright Tests / test (pull_request) Successful in 8m10s
2025-06-15 13:35:24 +02:00
cd6574389f Merge pull request 'Add a confirmation dialog before deleting a guest' (#284) from confirmation-dialog-remove-guest into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 51s
Playwright Tests / test (push) Successful in 11m49s
Build Nginx-based docker image / build-static-assets (push) Successful in 12m11s
Reviewed-on: #284
2025-06-15 11:28:14 +00:00
e9e0ec7c13 Update .nvmrc
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m21s
Add copyright notice / copyright_notice (pull_request) Successful in 1m59s
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Playwright Tests / test (pull_request) Successful in 11m39s
2025-06-15 13:27:44 +02:00
cb89310425 Update specs accordingly
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 55s
Add copyright notice / copyright_notice (pull_request) Successful in 1m7s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m53s
Playwright Tests / test (pull_request) Successful in 4m0s
2025-06-15 13:24:09 +02:00
1e2829da25 Merge pull request 'Fix the color of the table arrangements' (#285) from fix-table-arrangement-colors into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 41s
Playwright Tests / test (push) Successful in 5m37s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m4s
Reviewed-on: #285
2025-06-15 10:45:35 +00:00
4d1f83cc33 Fix the color of the table arrangements
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m8s
Add copyright notice / copyright_notice (pull_request) Successful in 1m8s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m13s
Playwright Tests / test (pull_request) Successful in 4m6s
2025-06-15 12:32:06 +02:00
471b98fb53 Add a confirmation dialog before deleting a guest
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m44s
Add copyright notice / copyright_notice (pull_request) Successful in 2m24s
Build Nginx-based docker image / build-static-assets (push) Successful in 8m30s
Playwright Tests / test (pull_request) Failing after 8m55s
2025-06-15 12:12:04 +02:00
Renovate Bot
055ef75510 Update node Docker tag to v24
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 2m49s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m50s
Build Nginx-based docker image / build-static-assets (push) Successful in 10m4s
Playwright Tests / test (pull_request) Successful in 10m24s
2025-06-15 02:04:31 +00:00
8306cfe249 Merge pull request 'Adjust group creation to avoid a full reload' (#283) from group-specs into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 44s
Playwright Tests / test (push) Successful in 4m18s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m1s
Reviewed-on: #283
2025-06-14 17:05:46 +00:00
67e4ad5d16 Refactor feature to add groups avoiding reload and improve specs
All checks were successful
Build Nginx-based docker image / build-static-assets (push) Successful in 2m0s
Check usage of free licenses / build-static-assets (pull_request) Successful in 45s
Add copyright notice / copyright_notice (pull_request) Successful in 59s
Playwright Tests / test (pull_request) Successful in 3m44s
2025-06-14 11:27:44 +02:00
5164491e64 Merge pull request 'Extract API mocks to their own file' (#282) from extract-mocks into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 34s
Playwright Tests / test (push) Successful in 4m7s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m44s
Reviewed-on: #282
2025-06-14 07:49:10 +00:00
89e9c211d7 Refactor: extract groups specs to their own file 2025-06-14 09:46:35 +02:00
02760e5068 Extract API mocks to their own file
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m11s
Add copyright notice / copyright_notice (pull_request) Successful in 1m27s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m12s
Playwright Tests / test (pull_request) Successful in 4m18s
2025-06-14 09:44:31 +02:00
2ebd9796e3 Merge pull request 'Fix minor UI bugs and test guest CRUD' (#281) from improve-specs-guests into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 46s
Playwright Tests / test (push) Successful in 4m14s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m46s
Reviewed-on: #281
2025-06-14 06:35:14 +00:00
c50263f760 Fix bug where updated guest is duplicated
All checks were successful
Build Nginx-based docker image / build-static-assets (push) Successful in 2m20s
Check usage of free licenses / build-static-assets (pull_request) Successful in 42s
Add copyright notice / copyright_notice (pull_request) Successful in 55s
Playwright Tests / test (pull_request) Successful in 3m3s
2025-06-14 08:22:13 +02:00
5c524c2559 Merge create and list guests into a single test 2025-06-14 07:28:03 +02:00
ae5a986f25 Merge pull request 'Update dependency bcrypt to v6' (#251) from renovate/bcrypt-6.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 53s
Playwright Tests / test (push) Successful in 4m13s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m21s
Reviewed-on: #251
2025-06-14 05:18:57 +00:00
0a28127c4d Merge pull request 'Update dependency @types/node to v22.15.31' (#276) from renovate/node-22.x into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #276
2025-06-14 05:18:51 +00:00
7ae23204ff Merge pull request 'Update dependency zod to v3.25.64' (#266) from renovate/zod-3.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #266
2025-06-14 05:18:41 +00:00
c000d1c9b4 Merge pull request 'Update dependency postcss to v8.5.5' (#280) from renovate/postcss-8.x into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #280
2025-06-14 05:18:26 +00:00
Renovate Bot
3b95dde33e Update dependency bcrypt to v6
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m29s
Add copyright notice / copyright_notice (pull_request) Successful in 3m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 21m46s
Playwright Tests / test (pull_request) Successful in 19m39s
2025-06-14 02:05:44 +00:00
Renovate Bot
2cae594794 Update dependency zod to v3.25.64
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 9m30s
Check usage of free licenses / build-static-assets (pull_request) Successful in 9m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 29m18s
Playwright Tests / test (pull_request) Successful in 23m16s
2025-06-14 02:05:27 +00:00
Renovate Bot
46fa8133c3 Update dependency postcss to v8.5.5
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m26s
Add copyright notice / copyright_notice (pull_request) Successful in 2m26s
Playwright Tests / test (pull_request) Successful in 18m57s
Build Nginx-based docker image / build-static-assets (push) Successful in 24m30s
2025-06-14 02:05:11 +00:00
Renovate Bot
5c5766dfe0 Update dependency @types/node to v22.15.31
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 2m11s
Check usage of free licenses / build-static-assets (pull_request) Successful in 58s
Build Nginx-based docker image / build-static-assets (push) Successful in 21m10s
Playwright Tests / test (pull_request) Successful in 24m7s
2025-06-14 02:05:02 +00:00
02a7270da0 Merge pull request 'Update dependency primereact to v10.9.6' (#265) from renovate/primereact-10.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m7s
Playwright Tests / test (push) Successful in 5m0s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m36s
Reviewed-on: #265
2025-06-13 10:40:18 +00:00
759fcde872 Merge pull request 'Update dependency use-debounce to v10.0.5' (#275) from renovate/use-debounce-10.x-lockfile into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Reviewed-on: #275
2025-06-13 10:40:09 +00:00
b1a5ea5a1f Merge pull request 'Update dependency @playwright/test to v1.53.0' (#277) from renovate/playwright-test-1.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #277
2025-06-13 10:40:00 +00:00
Renovate Bot
1bea961002 Update dependency @playwright/test to v1.53.0
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 5m50s
Add copyright notice / copyright_notice (pull_request) Successful in 8m0s
Playwright Tests / test (pull_request) Successful in 25m16s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m17s
2025-06-13 02:06:43 +00:00
Renovate Bot
83c2f1c43e Update dependency use-debounce to v10.0.5
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m51s
Add copyright notice / copyright_notice (pull_request) Successful in 8m49s
Build Nginx-based docker image / build-static-assets (push) Successful in 46m7s
Playwright Tests / test (pull_request) Successful in 49m58s
2025-06-13 02:06:07 +00:00
Renovate Bot
c5bd36d230 Update dependency primereact to v10.9.6
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 2m36s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m33s
Playwright Tests / test (pull_request) Successful in 46m21s
Build Nginx-based docker image / build-static-assets (push) Successful in 48m54s
2025-06-13 02:05:56 +00:00
a74ef0c8b6 Merge pull request 'Add a link to the invitation in the invitation card' (#262) from invitation-link into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 59s
Playwright Tests / test (push) Successful in 6m35s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m18s
Reviewed-on: #262
2025-06-12 21:08:05 +00:00
87cf2d3bb2 Merge pull request 'Display a basic invitation form on invites page' (#279) from invitation-form into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Successful in 1m57s
Playwright Tests / test (push) Has been cancelled
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Reviewed-on: #279
2025-06-12 21:04:34 +00:00
5c1f8b0dbe Update the path of the invitation
All checks were successful
Playwright Tests / test (pull_request) Has been skipped
Check usage of free licenses / build-static-assets (pull_request) Successful in 57s
Add copyright notice / copyright_notice (pull_request) Successful in 1m15s
Build Nginx-based docker image / build-static-assets (push) Successful in 11m23s
2025-06-12 22:56:37 +02:00
87bd3fac4b Add a link to the invitation in the invitation card
All checks were successful
Playwright Tests / test (pull_request) Has been skipped
Check usage of free licenses / build-static-assets (pull_request) Successful in 38s
Add copyright notice / copyright_notice (pull_request) Successful in 39s
Build Nginx-based docker image / build-static-assets (push) Successful in 2m20s
2025-06-02 00:08:42 +02:00
19 changed files with 605 additions and 781 deletions

View File

@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
node-version-file: .nvmrc
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Build the service that will be tested

2
.nvmrc
View File

@ -1 +1 @@
23.11.1
24.3.0

View File

@ -1,6 +1,6 @@
# Based on https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
FROM node:23-alpine AS base
FROM node:24-alpine AS base
# Install dependencies only when needed
FROM base AS deps

View File

@ -1,6 +1,6 @@
# Based on https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
FROM node:23-alpine AS base
FROM node:24-alpine AS base
# Install dependencies only when needed
FROM base AS deps

View File

@ -18,6 +18,7 @@ import { Toast } from 'primereact/toast';
import { Suspense, useEffect, useRef, useState } from 'react';
import InvitationsBoard from '@/app/ui/invitations/board';
import { Invitation, InvitationSerializer } from '@/app/lib/invitation';
import { Entity } from '@/app/lib/definitions';
export default function Page() {
@ -29,9 +30,9 @@ export default function Page() {
refreshGuests();
refreshInvitations();
}, []);
const toast = useRef<Toast>(null);
function refreshGuests() {
new AbstractApi<Guest>().getAll(new GuestSerializer(), (objects: Guest[]) => {
setGuests(objects);
@ -54,20 +55,20 @@ export default function Page() {
fetch(`/api/${slug}/groups/affinities/reset`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'X-CSRF-TOKEN': getCsrfToken(),
'Accept': 'application/json',
'X-CSRF-TOKEN': getCsrfToken(),
}
})
.then(response => {
if (response.ok) {
showAffinitiesResetSuccess();
} else {
console.error('Failed to reset affinities');
}
})
.catch(error => {
console.error('Error resetting affinities:', error);
});
.then(response => {
if (response.ok) {
showAffinitiesResetSuccess();
} else {
console.error('Failed to reset affinities');
}
})
.catch(error => {
console.error('Error resetting affinities:', error);
});
}
function showAffinitiesResetSuccess() {
@ -88,7 +89,22 @@ export default function Page() {
const [invitations, setInvitations] = useState<Array<Invitation>>([]);
function updateList<T extends Entity>(originalList: T[], element: T): T[] {
{
const index = originalList.findIndex(g => g.id === element?.id);
if (index !== -1) {
// Replace existing element
return [
element!,
...originalList.slice(0, index),
...originalList.slice(index + 1)
];
} else {
// Add new element at the start
return [element!, ...originalList];
}
}
}
return (
<div className="w-full">
@ -99,9 +115,9 @@ export default function Page() {
<GuestFormDialog
key={guestBeingEdited?.id}
groups={groups}
onCreate={(newGuest) => {
setGuests([newGuest!, ...guests]);
setGuestBeingEdited(undefined) ;
onCreate={(newGuest) => {
setGuests(guests => updateList(guests, newGuest));
setGuestBeingEdited(undefined);
}}
guest={guestBeingEdited}
visible={guestBeingEdited !== undefined}
@ -128,7 +144,10 @@ export default function Page() {
<GroupFormDialog
key={groupBeingEdited?.id}
groups={groups}
onCreate={() => { refreshGroups(); setGroupBeingEdited(undefined) }}
onCreate={(newGroup) => {
setGroups(groups => updateList(groups, newGroup));
setGroupBeingEdited(undefined)
}}
group={groupBeingEdited}
visible={groupBeingEdited !== undefined}
onHide={() => { setGroupBeingEdited(undefined) }}
@ -152,7 +171,7 @@ export default function Page() {
</div>
</ TabPanel>
<TabPanel header="Invitations" leftIcon="pi pi-envelope mx-2">
<InvitationsBoard guests={guests} invitations={invitations}/>
<InvitationsBoard guests={guests} invitations={invitations} />
</TabPanel>
</ TabView>
</div>

View File

@ -3,6 +3,7 @@
import { Entity } from '@/app/lib/definitions';
import { getCsrfToken, getSlug } from '@/app/lib/utils';
export interface Api<T extends Entity> {
getAll(serializable: Serializable<T>, callback: (objets: T[]) => void): void;
get(serializable: Serializable<T>, id: string, callback: (object: T) => void): void;
@ -30,6 +31,18 @@ export class AbstractApi<T extends Entity> implements Api<T> {
});
}
getAllPdf(serializable: Serializable<T>, callback: () => void): void {
fetch(`/api/${getSlug()}/${serializable.apiPath()}`, {
headers: {
'Accept': 'application/pdf',
}
}).then(res => res.blob())
.then(blob => {
var file = window.URL.createObjectURL(blob);
window.location.assign(file);
});
}
get(serializable: Serializable<T>, id: (string | undefined), callback: (object: T) => void): void {
const endpoint = id ? `/api/${getSlug()}/${serializable.apiPath()}/${id}` : `/api/${getSlug()}/${serializable.apiPath()}`;
fetch(endpoint)
@ -41,7 +54,7 @@ export class AbstractApi<T extends Entity> implements Api<T> {
});
}
update(serializable: Serializable<T>, object: T, callback: () => void): void {
update(serializable: Serializable<T>, object: T, callback: (updatedObject: T) => void): void {
const endpoint = object.id ? `/api/${getSlug()}/${serializable.apiPath()}/${object.id}` : `/api/${getSlug()}/${serializable.apiPath()}`;
fetch(endpoint, {
@ -52,7 +65,10 @@ export class AbstractApi<T extends Entity> implements Api<T> {
'Accept': 'application/json',
'X-CSRF-TOKEN': getCsrfToken(),
}
}).then(callback)
}).then((response) => response.json())
.then((data) => {
callback(serializable.fromJson(data));
})
.catch((error) => console.error(error));
}

View File

@ -34,7 +34,7 @@ export class TableSimulationSerializer implements Serializable<TableSimulation>
return new TableSimulation(data.id, data.tables.map((table: any) => {
return {
number: table.number,
guests: table.guests.map((guest: any) => new Guest(guest.id, guest.name, guest.group?.name, guest.group?.id, guest.color)),
guests: table.guests.map((guest: any) => new Guest(guest.id, guest.name, guest.color, guest.status, [], guest.group)),
discomfort: {
discomfort: table.discomfort.discomfort,
breakdown: {

View File

@ -5,7 +5,7 @@ import clsx from "clsx";
type ButtonColor = 'primary' | 'blue' | 'green' | 'red' | 'yellow' | 'gray';
export function classNames(type: ButtonColor) {
return (clsx("text-white py-1 px-2 mx-1 rounded disabled:opacity-50 disabled:cursor-not-allowed", {
return (clsx("text-white py-1 px-2 m-2 rounded disabled:opacity-50 disabled:cursor-not-allowed", {
'bg-blue-400 hover:bg-blue-600': type === 'primary' || type === 'blue',
'bg-green-500 hover:bg-green-600': type === 'green',
'bg-red-500 hover:bg-red-600': type === 'red',

View File

@ -14,7 +14,7 @@ import { useState } from 'react';
export default function GroupFormDialog({ groups, onCreate, onHide, group, visible }: {
groups: Group[],
onCreate?: () => void,
onCreate?: (newGroup: Group) => void,
onHide: () => void,
group?: Group,
visible: boolean,
@ -46,15 +46,15 @@ export default function GroupFormDialog({ groups, onCreate, onHide, group, visib
group.color = color;
group.parentId = parentId;
api.update(serializer, group, () => {
api.update(serializer, group, (newGroup) => {
resetForm();
onCreate && onCreate();
onCreate && onCreate(newGroup);
});
} else {
api.create(serializer, new Group(undefined, name, undefined, icon, undefined, parentId, color), () => {
api.create(serializer, new Group(undefined, name, undefined, icon, undefined, parentId, color), (newGroup) => {
resetForm();
onCreate && onCreate();
onCreate && onCreate(newGroup);
});
}
}

View File

@ -44,9 +44,9 @@ export default function GuestFormDialog({ groups, onCreate, onHide, guest, visib
guest.group!.id = group;
guest.status = status;
api.update(serializer, guest, () => {
api.update(serializer, guest, (updatedGuest) => {
resetForm();
onCreate && onCreate(guest);
onCreate && onCreate(updatedGuest);
});
} else {
api.create(serializer, new Guest(undefined, name, undefined, status, [], groups.find((g) => g.id === group)), (newGuest)=> {
@ -62,8 +62,8 @@ export default function GuestFormDialog({ groups, onCreate, onHide, guest, visib
<Dialog header="Add guest" visible={visible} style={{ width: '60vw' }} onHide={onHide}>
<div className="card flex justify-evenly py-5">
<FloatLabel>
<InputText id="username" className='rounded-sm' value={name} onChange={(e) => setName(e.target.value)} />
<label htmlFor="username">Username</label>
<InputText id="name" className='rounded-sm' value={name} onChange={(e) => setName(e.target.value)} />
<label htmlFor="name">Name</label>
</FloatLabel>
<FloatLabel>
<Dropdown id="group" className='rounded-sm min-w-32' value={group} onChange={(e) => setGroup(e.target.value)} options={

View File

@ -21,7 +21,12 @@ export default function GroupsTable({ groups, onUpdate, onEdit, onEditAffinities
const actions = (group: Group) => (
<div className="flex flex-row items-center">
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, group, onUpdate) }} />
<TrashIcon className='size-6 cursor-pointer' onClick={() => {
if (window.confirm(`Are you sure you want to delete guest "${group.name}"?`)) {
api.destroy(serializer, group, onUpdate)
}
}}
/>
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(group)} />
<AdjustmentsHorizontalIcon className='size-6 cursor-pointer' onClick={() => onEditAffinities(group)} />
</div>

View File

@ -3,7 +3,7 @@
'use client';
import { AbstractApi } from '@/app/api/abstract-api';
import { Guest , GuestSerializer} from '@/app/lib/guest';
import { Guest, GuestSerializer } from '@/app/lib/guest';
import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
import TableOfContents from '../components/table-of-contents';
@ -48,7 +48,12 @@ export default function guestsTable({ guests, onUpdate, onEdit }: {
</td>
<td>
<div className="flex flex-row items-center">
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, guest, onUpdate)}} />
<TrashIcon className='size-6 cursor-pointer' onClick={() => {
if (window.confirm(`Are you sure you want to delete guest "${guest.name}"?`)) {
api.destroy(serializer, guest, onUpdate)
}
}}
/>
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(guest)} />
</div>
</td>

View File

@ -5,10 +5,12 @@
import { AbstractApi } from "@/app/api/abstract-api";
import { Guest } from "@/app/lib/guest";
import { Invitation, InvitationSerializer } from "@/app/lib/invitation";
import { getSlug } from "@/app/lib/utils";
import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
import { TrashIcon } from "@heroicons/react/24/outline";
import { LinkIcon, TrashIcon } from "@heroicons/react/24/outline";
import { useEffect, useRef } from "react";
import { useState } from "react";
import { classNames } from "../components/button";
function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
invitation: Invitation,
@ -24,6 +26,8 @@ function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
const api = new AbstractApi<Invitation>();
const serializer = new InvitationSerializer();
const iconClassName = "w-5 h-5 text-white absolute top-2 opacity-0 group-hover:opacity-100 cursor-pointer";
useEffect(() => {
if (ref.current) {
return dropTargetForElements({
@ -53,8 +57,14 @@ function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
className="relative flex items-center justify-center w-full bg-green-800 border border-green-900 group"
style={{ aspectRatio: "1.618 / 1" }}
>
<LinkIcon
className={`${iconClassName} right-8`}
onClick={() => {
navigator.clipboard.writeText(`https://${window.location.host}/${getSlug()}/site/invitation/${invitation.id}`);
}}
/>
<TrashIcon
className="w-5 h-5 text-white absolute top-2 right-2 opacity-0 group-hover:opacity-100 cursor-pointer"
className={`${iconClassName} right-2`}
onClick={() => {
if (window.confirm("Are you sure you want to delete this invitation?")) {
api.destroy(serializer, invitation, () => {
@ -64,6 +74,7 @@ function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
}}
/>
{guests.length === 0 ? (
<p className="text-center text-yellow-500 text-lg italic">
(empty invitation)
@ -134,6 +145,12 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
});
}
function handleDownloadQrCodes() {
api.getAllPdf(serializer, () => {
console.log("QR codes downloaded");
});
}
return (
<div className="flex h-screen">
{/* Left Column: Guests */}
@ -154,11 +171,18 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
<button
onClick={handleCreateInvitation}
className="mb-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
className={classNames('primary')}
>
Create New Invitation
</button>
<button
onClick={handleDownloadQrCodes}
className={classNames('primary')}
>
Download QR codes
</button>
<div className="grid grid-cols-4 gap-6">

View File

@ -13,12 +13,12 @@
"@tiptap/react": "^2.14.0",
"@tiptap/starter-kit": "^2.14.0",
"autoprefixer": "10.4.21",
"bcrypt": "^5.1.1",
"bcrypt": "^6.0.0",
"clsx": "^2.1.1",
"dompurify": "^3.2.6",
"next": "15.3.3",
"next-auth": "5.0.0-beta.28",
"postcss": "8.5.4",
"next": "15.3.4",
"next-auth": "5.0.0-beta.29",
"postcss": "8.5.6",
"primeicons": "^7.0.0",
"primereact": "^10.8.2",
"react": "19.0.0-rc-f38c22b244-20240704",
@ -32,7 +32,7 @@
"devDependencies": {
"@playwright/test": "^1.52.0",
"@types/bcrypt": "^5.0.2",
"@types/node": "22.15.30",
"@types/node": "24.0.7",
"@types/react": "18.3.23",
"@types/react-dom": "18.3.7",
"wait-on": "^8.0.3"
@ -40,5 +40,5 @@
"engines": {
"node": ">=23.0.0"
},
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac"
"packageManager": "pnpm@10.12.3+sha512.467df2c586056165580ad6dfb54ceaad94c5a30f80893ebdec5a44c5aa73c205ae4a5bb9d5ed6bb84ea7c249ece786642bbb49d06a307df218d03da41c317417"
}

806
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

82
tests/groups.spec.ts Normal file
View File

@ -0,0 +1,82 @@
import { test, expect, Page } from '@playwright/test'
import mockGroupsAPI from './mocks/groups';
import mockGuestsAPI from './mocks/guests';
test('should allow CRUD on groups', async ({ page }) => {
await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
await page.getByRole('tab', { name: 'Groups' }).click();
await expect(page.getByRole('button', { name: 'Add new' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Reset affinities' })).toBeVisible();
// List all groups
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(0)).toHaveText('Name');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(1)).toHaveText('Color');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(2)).toHaveText('Confirmed');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(3)).toHaveText('Tentative');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(4)).toHaveText('Pending');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(5)).toHaveText('Declined');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(6)).toHaveText('Considered');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(7)).toHaveText('Total');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(8)).toHaveText('Actions');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s family');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(3)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(4)).toHaveText('1');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(6)).toHaveText('2');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(7)).toHaveText('3');
await expect(page.getByRole('row').nth(1).locator('svg:visible')).toHaveCount(3);
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(0)).toContainText('Pam\'s work');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(3)).toHaveText('2');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(4)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(6)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(7)).toHaveText('2');
await expect(page.getByRole('row').nth(2).locator('svg:visible')).toHaveCount(3);
// Add a new group
await page.getByRole('button', { name: 'Add new' }).click();
const dialog = page.getByRole('dialog');
await expect(dialog).toBeVisible();
await dialog.getByLabel('Name').fill("Pam's friends");
await dialog.getByRole('button', { name: 'Create' }).click();
await expect(page.getByRole('row')).toHaveCount(4); // 1 header row + 3 data rows
await expect(dialog).not.toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s friends');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(3)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(4)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(6)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(7)).toHaveText('0');
await expect(page.getByRole('row').nth(1).locator('svg:visible')).toHaveCount(3);
// Modify the newly added group
await page.getByRole('row').nth(1).locator('svg').nth(2).click(); // Click edit icon
await expect(dialog).toBeVisible();
await expect(dialog.getByLabel('Name')).toHaveValue("Pam's friends");
await dialog.getByLabel('Name').fill('Pam\'s best friends');
await dialog.getByRole('button', { name: 'Update' }).click();
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s best friends');
// Delete the newly added group
page.on('dialog', dialog => dialog.accept());
await page.getByRole('row').nth(1).locator('svg').nth(1).click(); // Click delete icon
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
});

View File

@ -1,88 +1,10 @@
import { test, expect, Page } from '@playwright/test'
import { mock } from 'node:test';
import { expect, test } from '@playwright/test';
import mockGroupsAPI from './mocks/groups';
import mockGuestsAPI from './mocks/guests';
const mockGuestsAPI = ({ page }: { page: Page }) => {
page.route('*/**/api/default/guests', async route => {
if (route.request().method() === 'GET') {
const json = [
{
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
"status": "tentative",
"name": "Kristofer Rohan DVM",
"group": {
"id": "2fcb8b22-6b07-4c34-92e3-a2535dbc5b14",
"name": "Childhood friends",
}
},
{
"id": "bd585c40-0937-4cde-960a-bb23acfd6f18",
"status": "invited",
"name": "Olevia Quigley Jr.",
"group": {
"id": "da8edf26-3e1e-4cbb-b985-450c49fffe01",
"name": "Work",
}
},
];
await route.fulfill({ json })
} else if (route.request().method() === 'POST') {
const json = {
"id":"ff58aa2d-643d-4c29-be9c-50e10ae6853c",
"name":"John Snow",
"status":"invited",
"group": {
"id": "da8edf26-3e1e-4cbb-b985-450c49fffe01",
"name": "Work",
}
};
await route.fulfill({ json });
}
})
}
const mockGroupsAPI = ({ page }: { page: Page }) => {
page.route('*/**/api/default/groups', async route => {
const json = [
{
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
"icon": "pi pi-users",
"parent_id": null,
"color": "#ff0000",
"attendance": {
"total": 3,
"considered": 2,
"invited": 1,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
},
{
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#00ff00",
"attendance": {
"total": 2,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 2
}
},
];
await route.fulfill({ json })
})
}
test('should display the list of guests', async ({ page }) => {
test('should allow CRUD on guests', async ({ page }) => {
await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
@ -92,89 +14,63 @@ test('should display the list of guests', async ({ page }) => {
await expect(page.getByRole('tab', { name: 'Groups' })).toBeVisible();
await expect(page.getByRole('tab', { name: 'Invitations' })).toBeVisible();
// List all guests
await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Kristofer Rohan DVM' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Childhood friends' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: "Pam's family" })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Tentative' })).toBeVisible();
await expect(page.getByRole('row').nth(1).locator('svg')).toHaveCount(2);
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Olevia Quigley Jr.' })).toBeVisible();
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Work' })).toBeVisible();
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: "Pam's work" })).toBeVisible();
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Invited' })).toBeVisible();
await expect(page.getByRole('row').nth(2).locator('svg')).toHaveCount(2);
});
test('should allow creating a new guest', async ({ page }) => {
await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
// Add a new guest
await page.getByRole('button', { name: 'Add new' }).click();
await page.getByRole('dialog').getByLabel('Name').fill('John Snow');
await page.keyboard.press('Tab');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('Enter');
await page.locator('#group').click();
await page.getByRole('option', { name: "Pam's work" }).click();
await page.keyboard.press('Tab');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('Enter');
await page.locator('#status').click();
await page.getByRole('option', { name: 'Invited' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Create' }).click();
await expect(page.getByText('There are 3 elements in the list')).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'John Snow' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Work' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: "Pam\'s work" })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Invited' })).toBeVisible();
await expect(page.getByRole('row').nth(1).locator('svg')).toHaveCount(2);
// Edit the just-added John Snow
await page.getByRole('row').nth(1).locator('svg').nth(1).click(); // Click edit icon
const dialog = page.getByRole('dialog');
await expect(dialog.getByLabel('Name')).toHaveValue('John Snow');
await dialog.getByLabel('Name').fill('John Fire');
await dialog.locator('#group').click();
await page.getByRole('option', { name: "Pam's family" }).click();
await dialog.locator('#status').click();
await page.getByRole('option', { name: 'Declined' }).click();
await dialog.getByRole('button', { name: 'Update' }).click();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'John Fire' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Pam\'s Family' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Declined' })).toBeVisible();
await expect(page.getByText('There are 3 elements in the list')).toBeVisible();
// Delete John Fire
page.on('dialog', dialog => dialog.accept());
await page.getByRole('row').nth(1).locator('svg').nth(0).click(); // Click delete icon
await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
});
test('should display the list of groups', async ({ page }) => {
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
await page.getByRole('tab', { name: 'Groups' }).click();
await expect(page.getByRole('button', { name: 'Add new' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Reset affinities' })).toBeVisible();
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(0)).toHaveText('Name');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(1)).toHaveText('Color');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(2)).toHaveText('Confirmed');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(3)).toHaveText('Tentative');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(4)).toHaveText('Pending');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(5)).toHaveText('Declined');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(6)).toHaveText('Considered');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(7)).toHaveText('Total');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(8)).toHaveText('Actions');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s family');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(3)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(4)).toHaveText('1');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(6)).toHaveText('2');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(7)).toHaveText('3');
await expect(page.getByRole('row').nth(1).locator('svg:visible')).toHaveCount(3);
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(0)).toContainText('Pam\'s work');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(3)).toHaveText('2');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(4)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(6)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(7)).toHaveText('2');
await expect(page.getByRole('row').nth(2).locator('svg:visible')).toHaveCount(3);
});

86
tests/mocks/groups.tsx Normal file
View File

@ -0,0 +1,86 @@
import { Page } from "@playwright/test";
export default async function mockGroupsAPI({ page }: { page: Page }): Promise<void> {
page.route('*/**/api/default/groups', async route => {
if (route.request().method() === 'GET') {
const json = [
{
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
"icon": "pi pi-users",
"parent_id": null,
"color": "#ff0000",
"attendance": {
"total": 3,
"considered": 2,
"invited": 1,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
},
{
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#00ff00",
"attendance": {
"total": 2,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 2
}
},
];
await route.fulfill({ json })
} else if (route.request().method() === 'POST') {
const json = {
"id": "4d55bc34-6f42-4e2e-82a1-71ae32da2466",
"name": "Pam's friends",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#0000ff",
"attendance": {
"total": 0,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
}
await route.fulfill({ json })
}
})
page.route("*/**/api/default/groups/*", async route => {
if (route.request().method() === 'PUT') {
const json = {
"id": "4d55bc34-6f42-4e2e-82a1-71ae32da2466",
"name": "Pam's best friends",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#0000ff",
"attendance": {
"total": 0,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
}
await route.fulfill({ json });
} else if (route.request().method() === 'DELETE') {
const json = {}
await route.fulfill({ json });
}
});
}

61
tests/mocks/guests.tsx Normal file
View File

@ -0,0 +1,61 @@
import { Page } from "@playwright/test";
export default async function mockGuestsAPI({ page }: { page: Page }): Promise<void> {
page.route('*/**/api/default/guests', async route => {
if (route.request().method() === 'GET') {
const json = [
{
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
"status": "tentative",
"name": "Kristofer Rohan DVM",
"group": {
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
}
},
{
"id": "bd585c40-0937-4cde-960a-bb23acfd6f18",
"status": "invited",
"name": "Olevia Quigley Jr.",
"group": {
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
}
},
];
await route.fulfill({ json })
} else if (route.request().method() === 'POST') {
const json = {
"id": "ff58aa2d-643d-4c29-be9c-50e10ae6853c",
"name": "John Snow",
"status": "invited",
"group": {
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
}
};
await route.fulfill({ json });
}
})
page.route("*/**/api/default/guests/*", async route => {
if (route.request().method() === 'PUT') {
const json = {
"id": "ff58aa2d-643d-4c29-be9c-50e10ae6853c",
"name": "John Fire",
"status": "declined",
"group": {
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
}
}
await route.fulfill({ json });
} else if (route.request().method() === 'DELETE') {
const json = {}
await route.fulfill({ json });
}
});
}