WIP: Add client unit testing #74

Draft
luca0N wants to merge 10 commits from dev_client_tests into dev
Owner

Add unit testing to the web app client using Vitest.

Add unit testing to the web app client using Vitest.
luca0N self-assigned this 2026-05-20 23:45:40 +00:00
Switch to `vitest' for unit testing in the web app project, the default
unit test package provided for new Angular projects.
Add missing `@angular/localize' reference that caused issues when
running unit tests in the web app Angular project.
luca0N changed title from Add client unit testing to WIP: Add client unit testing 2026-06-05 11:19:16 +00:00
Add workflow for running client unit tests
Some checks failed
/ Test client (push) Failing after 48s
7cc850cec4
Create CI workflow to run unit testing for the web app client.
Update Node.js package in client workflow
Some checks failed
/ Test client (push) Failing after 58s
0b5ab62c39
Use the `nodejs-current' Alpine Linux package as opposed to `nodejs', as
Angular requires a minimum version of Node.js that is not available in
the latter.
Fix web app unit testing
Some checks failed
/ Test client (push) Has been cancelled
ab7dbb44fe
Fix the web app client unit testing by making `ConfigManager.ts'
@Injectable (and move it to the `services/' subdirectory), and perform
some minor code refactoring (to reflect these changes in files that use
ConfigManager).
luca0N force-pushed dev_client_tests from ab7dbb44fe
Some checks failed
/ Test client (push) Has been cancelled
to edf4cc9aac
Some checks failed
/ Test client (push) Failing after 55s
2026-06-16 22:29:25 +00:00
Compare
luca0N force-pushed dev_client_tests from edf4cc9aac
Some checks failed
/ Test client (push) Failing after 55s
to 28eff1a35e
All checks were successful
/ Test client (push) Successful in 58s
2026-06-16 22:34:14 +00:00
Compare
luca0N force-pushed dev_client_tests from 28eff1a35e
All checks were successful
/ Test client (push) Successful in 58s
to 38e60eb4e8 2026-06-16 22:39:11 +00:00
Compare
Author
Owner
  • Force-push from ab7dbb44fe to edf4cc9aac was made to revert an erroneous change in the workflow
  • Force-push from edf4cc9aac to 28eff1a35e was made to fix an outdated source file which referenced the old path for ConfigManager
  • Force-push from 28eff1a35e to 38e60eb4e8 was made to change the commit message, detailing that partial support for HttpClient was added.

HttpClient will replace the direct fetch API used in the web app client because it has unit test support built-in, making it much easier to run this workflow.

- Force-push from ab7dbb44fe to edf4cc9aac was made to revert an erroneous change in the workflow - Force-push from edf4cc9aac to 28eff1a35e was made to fix an outdated source file which referenced the old path for ConfigManager - Force-push from 28eff1a35e to 38e60eb4e8 was made to change the commit message, detailing that partial support for HttpClient was added. HttpClient will replace the direct fetch API used in the web app client because it has unit test support built-in, making it much easier to run this workflow.
Use HttpClient in ServerComms
Some checks failed
/ Test client (push) Failing after 55s
ece2380978
Replace the fetch API with HttpClient in the ServerComms class, as part
of the ongoing migration intended to introduce unit testing in the web
app client.
luca0N force-pushed dev_client_tests from ece2380978
Some checks failed
/ Test client (push) Failing after 55s
to 20841f9290
Some checks failed
/ Test client (push) Failing after 55s
2026-06-21 20:06:21 +00:00
Compare
luca0N force-pushed dev_client_tests from 20841f9290
Some checks failed
/ Test client (push) Failing after 55s
to 3bce136eea
All checks were successful
/ Test client (push) Successful in 1m0s
2026-06-21 20:09:14 +00:00
Compare
Author
Owner

The previous force-push operations (from ece2380978 to 20841f9290, and from 20841f9290 to 3bce136eea) were made to fix syntax errors in the code, and to remove WIP code that is not ready to be committed.

The previous force-push operations (from ece2380978 to 20841f9290, and from 20841f9290 to 3bce136eea) were made to fix syntax errors in the code, and to remove WIP code that is not ready to be committed.
In the web app client, replace the unused Jasmine types with Vitest's in
`tsconfig.spec.ts'.  This will be required in a future commit where
Vitest types will be used, and are implicitly required.
Add unit testing for web app `ServerComms'
All checks were successful
/ Test client (push) Successful in 1m0s
2fa1ff8830
Add unit tests for the `ServerComms' class in the web app client, and
use `reject' in the `authenticate' function, as required to get the
combination of HttpClient and Vitest's `rejects.toThrow' to work.
Add unit testing for `ConfigManager'
All checks were successful
/ Test client (push) Successful in 1m1s
2e4bcbe413
Add unit tests for the `ConfigManager' class.  This new unit testing
source file checks for two of the public functions in the
`ConfigManager' class, which return the server configuration.  The unit
test checks to see if both return the configuration that matches that of
the mocked response.
Move and refactor LiveConnection class
All checks were successful
/ Test client (push) Successful in 1m1s
f76c24e3aa
Perform some minor code refactoring by moving the @Injectable
LiveConnection class to the `services/' subdirectory, which contains
other @Injectable classes used in the project, and create a new
@Injectable class for handling WebSocket connections, which will be used
in a future commit to mock WebSocket connections in unit tests.
All checks were successful
/ Test client (push) Successful in 1m1s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin dev_client_tests:dev_client_tests
git switch dev_client_tests

Merge

Merge the changes and update on Forgejo.
git switch dev
git merge --no-ff dev_client_tests
git switch dev_client_tests
git rebase dev
git switch dev
git merge --ff-only dev_client_tests
git switch dev_client_tests
git rebase dev
git switch dev
git merge --no-ff dev_client_tests
git switch dev
git merge --squash dev_client_tests
git switch dev
git merge --ff-only dev_client_tests
git switch dev
git merge dev_client_tests
git push origin dev
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#11 Add tests
luca0N/lanbassador
Reference
luca0N/lanbassador!74
No description provided.