Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap some test cases to vitest #2462

Merged

Conversation

worksofliam
Copy link
Contributor

@worksofliam worksofliam commented Jan 16, 2025

Start to replace UI testing framework with vitest.

How to test locally:

  1. Checkout this PR
  2. npm i to fetch the new deps
  3. Make a copy of src/api/.env.sample named .env and enter details of the system for the tests to run on
  4. npm run test

Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
@worksofliam worksofliam temporarily deployed to testing_environment January 16, 2025 18:59 — with GitHub Actions Inactive
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Copy link
Contributor

github-actions bot commented Jan 16, 2025

👋 A new build is available for this PR based on 19a2673.

Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
@worksofliam worksofliam changed the title Refactor and reorganize project structure for improved clarity Swap some test cases to vitest Jan 17, 2025
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Refactor and reorganize code structure
@worksofliam worksofliam marked this pull request as ready for review January 21, 2025 19:45
@worksofliam
Copy link
Contributor Author

@sebjulliand are you able to help determine why this test is failing?

tests/suites/content.test.ts > Content Tests > getMemberList (advanced filtering): src/api/tests/suites/content.test.ts#L434
AssertionError: expected +0 not to be +0 // Object.is equality ❯ tests/suites/content.test.ts:434:38

Co-authored-by: Sanjula Ganepola <32170854+SanjulaGanepola@users.noreply.github.com>
@worksofliam
Copy link
Contributor Author

@SanjulaGanepola that did it! Thanks! The last issue needs to be fixed by swapping out the system we're testing on.

The current system doesn't have git, which we reference in our test cases.

Copy link
Member

@SanjulaGanepola SanjulaGanepola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything passes on my end. Just left some minor comments

Comment on lines 40 to 45
export class JsonStorage extends BaseStorage {
protected readonly globalState: Map<string, any> = new Map<string, any>();

constructor() {
super();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BaseStorage expects 1 argument now due to the change we made in the other PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot. Cheers!

src/api/tests/suites/components.test.ts Show resolved Hide resolved
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
Copy link
Member

@SanjulaGanepola SanjulaGanepola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@worksofliam
Copy link
Contributor Author

@SanjulaGanepola Thanks mate!! I think we need to wait until we get a system that can run the tests without fail. I have asked Jesse to get git installed onto the Sandbox system (iopen) where these are running to fix it. Hopefully that will be soon, otherwise I will try another system. What do you think?

@worksofliam worksofliam temporarily deployed to testing_environment January 22, 2025 19:35 — with GitHub Actions Inactive
@worksofliam
Copy link
Contributor Author

@SanjulaGanepola I managed to get it installed! So, I say, let's go ahead and merge. Thanks for everything!

@worksofliam worksofliam merged commit 7666e77 into cleanup/seperate_frontend Jan 22, 2025
2 checks passed
@worksofliam worksofliam temporarily deployed to testing_environment January 22, 2025 19:40 — with GitHub Actions Inactive
@worksofliam worksofliam deployed to testing_environment January 23, 2025 14:02 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants