8 Commits

Author SHA1 Message Date
Abdullah Atta
2d93a17f34 web: fix all failing tests 2024-07-08 11:22:14 +05:00
Abdullah Atta
9e1a864f54 web: fix tests 2024-03-26 11:45:09 +05:00
Abdullah Atta
9116a24392 global: update license year to 2023 2023-01-16 13:48:28 +05:00
Abdullah Atta
77c9db0faa web: only check for encryption-key length 2022-11-23 16:22:04 +05:00
Abdullah Atta
bd3b5a4b98 web: redirect if logged in user navigates to unauthorized routes (fixes #907) 2022-09-17 00:11:48 +05:00
Abdullah Atta
b83aab3c3b web: increase user.test timeout to 45s 2022-09-16 09:31:36 +05:00
Abdullah Atta
f149d6c523 web: add test for login & sync 2022-09-16 08:07:45 +05:00
Abdullah Atta
d31a43b463 web: rewrite the whole test suite to be more resilient
**Why?**
The old test suite was a confusing mess, hard to maintain, update, and
add more tests to. It lacked a much needed layer of expressivity &
the reusable functions were all over the place.
Since it used a global `page` (by mistake), it couldn't run in parallel.
Moreover, the global `page` approach caused random flakiness.

All the above reasons led to this OM (Object Model) based approach to tests.
The tests are now much more expressive, reslient, resuable & easier to
maintain. During the rewriting process I also added a couple more
tests (about 10) so this is a net improvement.

Previously, running the tests were also quite slow (15-25s avg). This has
now been improved to (5-8s avg) by running the tests in production.
This means the app now requires to be built before running the tests:

```sh
npm run build:test:web # this is only required once
npm run test:web
```
2022-09-14 11:50:24 +05:00