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

feat: test cases for vaults ui #251

Merged
merged 15 commits into from Mar 15, 2024
Merged

feat: test cases for vaults ui #251

merged 15 commits into from Mar 15, 2024

Conversation

rabi-siddique
Copy link
Contributor

@rabi-siddique rabi-siddique commented Mar 12, 2024

The PR adds end-to-end test cases for:

  • Connecting with Keplr Wallet
  • Creating a new Vault
  • Updating a Vault with different flows.
  • Closing a Vault.

How to execute tests:

  • Start the agoric chain with the following command:
docker run -d -p 26657:26657 -p 1317:1317 -p 9090:9090 ghcr.io/agoric/agoric-3-proposals:main
  • Start the local server for inter-dapp
yarn dev
  • Execute the tests using the following command:
yarn test:e2e

@rabi-siddique rabi-siddique changed the title Test Cases for Vaults UI Test Cases for Vaults UI(WIP) Mar 12, 2024
@rabi-siddique rabi-siddique marked this pull request as draft March 12, 2024 10:23
@rabi-siddique rabi-siddique changed the title Test Cases for Vaults UI(WIP) Test Cases for Vaults UI Mar 12, 2024
@rabi-siddique rabi-siddique marked this pull request as ready for review March 12, 2024 12:13
@rabi-siddique rabi-siddique marked this pull request as draft March 12, 2024 16:12
test/e2e/ReadMe.md Outdated Show resolved Hide resolved
test/e2e/ReadMe.md Outdated Show resolved Hide resolved
@rabi-siddique rabi-siddique marked this pull request as ready for review March 13, 2024 06:48
@rabi-siddique rabi-siddique changed the title Test Cases for Vaults UI feat: test cases for vaults ui Mar 14, 2024
.gitignore Outdated Show resolved Hide resolved
test/e2e/README.md Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
Copy link
Collaborator

@samsiegart samsiegart left a comment

Choose a reason for hiding this comment

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

Looks like lint is failing, maybe adding an eslintrc like https://github.com/frazarshad/dapp-psm/blob/79bb3102a476b00ca685b75087dd54b659426e60/tests/e2e/.eslintrc.cjs should do the trick?

@rabi-siddique
Copy link
Contributor Author

Looks like lint is failing, maybe adding an eslintrc like https://github.com/frazarshad/dapp-psm/blob/79bb3102a476b00ca685b75087dd54b659426e60/tests/e2e/.eslintrc.cjs should do the trick?

@samsiegart Thanks for pointing it out. I've addressed the linting issue. I had to add some eslint-specific dependencies and make code changes around that. Turns out, in dapp-psm, there weren't many linting issues because linter is applied to the src folder only and as a result, it never gets applied to the tests folder there. In dapp-inter, our linter isn't restricted to the src folder.

@samsiegart samsiegart self-requested a review March 15, 2024 17:15
@samsiegart
Copy link
Collaborator

We're close now, lint is passing but yarn test is failing:

⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/e2e/specs/test.spec.js [ test/e2e/specs/test.spec.js ]
ReferenceError: describe is not defined
 ❯ test/e2e/specs/test.spec.js:2:1
      1| /* eslint-disable ui-testing/no-disabled-tests */
      2| describe('Vaults UI Test Cases', () => {
       | ^
      3|   context('Test commands', () => {
      4|     let collateralizationRatio;

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed | 1 passed (2)
      Tests  16 passed (16)

I think we can solve this by ignoring the e2e tests in vitest.config.ts like: Agoric/dapp-psm@fff09f5

@rabi-siddique
Copy link
Contributor Author

We're close now, lint is passing but yarn test is failing:

⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/e2e/specs/test.spec.js [ test/e2e/specs/test.spec.js ]
ReferenceError: describe is not defined
 ❯ test/e2e/specs/test.spec.js:2:1
      1| /* eslint-disable ui-testing/no-disabled-tests */
      2| describe('Vaults UI Test Cases', () => {
       | ^
      3|   context('Test commands', () => {
      4|     let collateralizationRatio;

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed | 1 passed (2)
      Tests  16 passed (16)

I think we can solve this by ignoring the e2e tests in vitest.config.ts like: Agoric/dapp-psm@fff09f5

@samsiegart Addressed. Thanks for the assistance. :)

@samsiegart samsiegart merged commit faa3515 into Agoric:main Mar 15, 2024
2 of 3 checks passed
Copy link

Network:
Commit: faa3515
Ref: refs/heads/main
IPFS v1 hash: bafybeic4ni3tpq4sb4inpktm5kmolydonblp2ispz6zvc3ptgvptznrdpm
CF - DWeb - 4EVERLAND

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.

4 participants