Agoric / dapp-inter

User application for Agoric Inter Protocol—Vaults, BLD Boost, Liquidations, etc.
2 stars 7 forks source link

feat: test cases for vaults ui #251

Closed rabi-siddique closed 3 months ago

rabi-siddique commented 3 months ago

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

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 commented 3 months ago

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 commented 3 months ago

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: https://github.com/Agoric/dapp-psm/pull/125/commits/fff09f5e6106907a06f8d357e666217776997199

rabi-siddique commented 3 months ago

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. :)

github-actions[bot] commented 3 months ago

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