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

test: add test #237

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

test: add test #237

wants to merge 16 commits into from

Conversation

gpBlockchain
Copy link
Collaborator

@gpBlockchain gpBlockchain commented Apr 18, 2023

What Changed

Resolve #223
This PR dependent on #239

add create wallet && import wallet test

Motivation

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Merging #237 (75d4b24) into main (bc64adb) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #237   +/-   ##
=======================================
  Coverage   75.88%   75.88%           
=======================================
  Files          62       62           
  Lines        1497     1497           
  Branches      216      216           
=======================================
  Hits         1136     1136           
  Misses        337      337           
  Partials       24       24           
Impacted Files Coverage Δ
packages/utils/src/env.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@homura homura added the tests Add or improve existing tests label Apr 18, 2023
@gpBlockchain gpBlockchain changed the title test: add create wallet && import wallet test test: add test Apr 19, 2023
await page.getByLabel('Name').fill(existName);
await page.getByLabel('URL').fill('https://testnet.ckbapp.dev/');
await page.getByRole('button', { name: 'Add' }).click();
await page.getByText(existName).allInnerTexts();
Copy link
Contributor

Choose a reason for hiding this comment

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

we should get inner tests and asset it to contain two Testnet

expect('').toBe('failed');
});

it('should get networkChange that the url is not in whitelist', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems this test case should be moved to "change-network.test.ts"

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a duplicate test, I will remove it.

});

it('should get networkChange that the url is not in whitelist', async () => {
await page.evaluate(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the purpose of this patch watching current nexus network? maybe use ckb_getBlockchainInfo instead

*/
it.todo('should work that add 192.168.. url');

it('should work that add url is http', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

should wallet_enable work that add url prefix is http

});
expect(ckbNetworkName).toBe('ckb_testnet');
});
it('should get ckb name that change network is user added', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like a composed test case for "add network" and "change network", is it necessary?


DefaultTestEnv.setupTest({ initWalletWithDefaults: true });

describe('Show account details', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not use word account as a term on UTXO wallet.


it('should get networkChange that the url is not in whitelist', async () => {
await page.evaluate(() => {
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not need it anymore.

await page.getByRole('button', { name: 'Next' }).click();
});

it('should warn when the input password is too short', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the UI, it is not a warning, it is a error when user input is not correct.
So using word error is more clear.

IronLu233 and others added 2 commits May 4, 2023 17:27
* docs: rule-based ownership skeleton

Signed-off-by: homura <[email protected]>

* docs: example for p2sh upgrade

Signed-off-by: homura <[email protected]>

* feat: a testkit pkg for unit test

Signed-off-by: homura <[email protected]>

* docs(testkit): jest example

Signed-off-by: homura <[email protected]>

* docs: custody-unlocking and serialization

* fix(deps): update dependency zustand to v4.3.7

* chore(deps): update jest monorepo

* chore(deps): update dependency @types/chrome to v0.0.233

* chore(deps): update dependency @auto-it/upload-assets to v10.45.0

* feat(detect-ckb): a module for detecting injected ckb

* fix(ownership-providers): inject witness and cellDeps auto

* chore: unnecessary root babel config

* chore: examples with provider

* chore: update lock file

* fix: eslint

* feat(detect-ckb): detecting injected ckb test cases

* test(ownership-providers): update failed test cases

* chore(detect-ckb): consistent nexus pkg version

* chore(example): tip when nexus is not installed

* chore: update lock file

* fix(ownership-providers): inject witness and cellDeps auto

* test(ownership-providers): update failed test cases

* fix(extension-chrome): receiving end does not exist

* feat(extension-chrome): add method `signTransaction`

* fix: protocol doc not generated

* refactor: refactor code

* fix: not works on real world data

* test: refine unit tests

* refactor: simplify rpc object parse

* docs: tutorial

* chore: update lock file

* chore(deps): update dependency prettier to v2.8.8

* feat: remove witness from existing input lock

* Update CHANGELOG.md [skip ci]

* Bump manifest version to: 0.0.16 [skip ci]

* Bump version to: v0.0.16 [skip ci]

* refactor(detect-ckb): customizable types of detected ckb

* test(detect-ckb): eslint error since no floating promise

* chore: show tx hash after sending tx in example

* chore: update lock file

* chore: update lock file

* refactor: rm unnecessary code

* test: rm unused cases

* feat(ownership-provider): Ownership provider send transaction

* revert(ownership-provider): revert payFee and sign

* chore: fix incorrect coverage in code cov

* chore: fix release error

* chore: run e2e test before release

* docs: explain for `byOutputIndexes` when `payFee`

* Update CHANGELOG.md [skip ci]

* Bump manifest version to: 0.0.17 [skip ci]

* Bump version to: v0.0.17 [skip ci]

* fix(ownership-provider): add method  `isOwnedByWallet`

* feat: a ckb node wrapper in js

* fix(ownership-provider): support unsigned transaction

* fix: e2e CI error

* feat(ownership-providers): support payFee and signTransaction in send transaction

* chore: the real ts coverage

* refactor: Top-to-bottom implementation

* feat: find out ownedLocks when signTransaction

* chore: avoid chrome extension error

* fix: filter type script cell when pay fee

* refactor(e2e): make the config more clear

* chore: extract `isDerivedLocks` move into ScriptInfoDb

* test(e2e): added a transfer test

* docs(e2e): how to launch an e2e node

* test: add unit test for send transaction

* fix: @nexus-wallet/testkit depended on extension-chrome move to `devDependencies`

* Update CHANGELOG.md [skip ci]

* Bump manifest version to: 0.0.18 [skip ci]

* Bump version to: v0.0.18 [skip ci]

* test: modify code for coverage

* chore: avoid merge failures

* refactor: modify toml config

* refactor: use lodash.random instead of random

* refactor: remove unused choose-port

* fix: logic bug

* chore: update package-lock

* test: make txWithFee calculation more clear

* refactor: use extended map for clearify code

* refactor: optimize Map structures

* chore: fix release error in pipeline

* Update CHANGELOG.md [skip ci]

* Bump manifest version to: 0.0.19 [skip ci]

* Bump version to: v0.0.19 [skip ci]

* test: refine e2e test case name

---------

Signed-off-by: homura <[email protected]>
Co-authored-by: homura <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pygman <[email protected]>
Co-authored-by: zhangyouxin <[email protected]>
Co-authored-by: github-actions <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Add or improve existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate E2E test
4 participants