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

Regression tests for "Near" global functions #22

Open
7 of 21 tasks
elliotBraem opened this issue Jun 20, 2024 · 0 comments
Open
7 of 21 tasks

Regression tests for "Near" global functions #22

elliotBraem opened this issue Jun 20, 2024 · 0 comments
Labels
enabler enables more work

Comments

@elliotBraem
Copy link
Contributor

elliotBraem commented Jun 20, 2024

This is in reference to the Near object defined in the near-social-vm, code block below:

https://github.com/NearSocial/VM/blob/6047c6a9b96f3de14e600c1d2b96c432bbb76dd4/src/lib/vm/vm.js#L1614C5-L1684C7

Tests

Near.view

  • should throw error if appropriate arguments are not provided
  • should make a request to the provided contract and method, with arguments
  • should use the provided blockId/finality if provided
  • should use the latest blockId/finality if not provided
  • should not make polling requests if subscribe is false
  • should make polling requests every 5 seconds if subscribe is true
  • should return null for the first miss, when result is not cached
  • should return undefined after first miss, when result is cached and not valid
  • should return data after first miss, when result is cached and valid

Near.asyncView

  • should throw error if appropriate arguments are not provided
  • should make a request to the provided contract and method, with arguments
  • should return a promise

Near.block

  • should return null for the first miss, when result is not cached
  • should return data after first miss, when result is cached and valid

Near.call

not logged in

  • should throw "No wallet selected" error

arguments: (contractName, methodName, args?, gas?, deposit?)

  • should throw error if appropriate arguments are not provided
  • should open confirmation modal with appropriate details

arguments: ({ tx })

  • should throw error if transaction object argument is invalid
  • should open confirmation modal with appropriate details

arguments: [{ tx }, ...]

  • should throw error if transaction objects in array argument is valid
  • should open confirmation modal with appropriate details
@elliotBraem elliotBraem added the enabler enables more work label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enabler enables more work
Projects
None yet
Development

No branches or pull requests

1 participant