|
1 | | -import {assert} from 'chai' |
2 | | -import {PermissionLevel, SessionKit} from '@wharfkit/session' |
| 1 | +// import {assert} from 'chai' |
| 2 | +// import {PermissionLevel, SessionKit} from '@wharfkit/session' |
3 | 3 |
|
4 | | -import {WalletPluginTokenPocket} from '$lib' |
5 | | -import {mockFetch} from '$test/utils/mock-fetch' |
6 | | -import {MockStorage} from '$test/utils/mock-storage' |
7 | | -import {MockUserInterface} from '$test/utils/mock-ui' |
| 4 | +// import {WalletPluginTokenPocket} from '$lib' |
| 5 | +// import {mockFetch} from '$test/utils/mock-fetch' |
| 6 | +// import {MockStorage} from '$test/utils/mock-storage' |
| 7 | +// import {MockUserInterface} from '$test/utils/mock-ui' |
8 | 8 |
|
9 | | -const mockChainDefinition = { |
10 | | - id: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906', |
11 | | - url: 'https://eos.greymass.com', |
12 | | -} |
| 9 | +// const mockChainDefinition = { |
| 10 | +// id: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906', |
| 11 | +// url: 'https://eos.greymass.com', |
| 12 | +// } |
13 | 13 |
|
14 | | -const mockPermissionLevel = PermissionLevel.from('wharfkit1111@test') |
| 14 | +// const mockPermissionLevel = PermissionLevel.from('wharfkit1111@test') |
15 | 15 |
|
16 | | -const mockSessionKitOptions = { |
17 | | - appName: 'unittests', |
18 | | - chains: [mockChainDefinition], |
19 | | - fetch: mockFetch, // Required for unit tests |
20 | | - storage: new MockStorage(), |
21 | | - ui: new MockUserInterface(), |
22 | | - walletPlugins: [new WalletPluginTokenPocket()], |
23 | | -} |
| 16 | +// const mockSessionKitOptions = { |
| 17 | +// appName: 'unittests', |
| 18 | +// chains: [mockChainDefinition], |
| 19 | +// fetch: mockFetch, // Required for unit tests |
| 20 | +// storage: new MockStorage(), |
| 21 | +// ui: new MockUserInterface(), |
| 22 | +// walletPlugins: [new WalletPluginTokenPocket()], |
| 23 | +// } |
24 | 24 |
|
25 | | -suite('wallet plugin', function () { |
26 | | - this.timeout(120 * 1000) |
27 | | - this.slow(5 * 1000) |
| 25 | +// suite('wallet plugin', function () { |
| 26 | +// this.timeout(120 * 1000) |
| 27 | +// this.slow(5 * 1000) |
28 | 28 |
|
29 | | - // test('login and sign', async function () { |
| 29 | +// // test('login and sign', async function () { |
30 | 30 |
|
31 | | - // const kit = new SessionKit(mockSessionKitOptions) |
32 | | - // const { session } = await kit.login({ |
33 | | - // chain: mockChainDefinition.id, |
34 | | - // permissionLevel: mockPermissionLevel, |
35 | | - // }) |
36 | | - // assert.isTrue(session.chain.equals(mockChainDefinition)) |
37 | | - // assert.isTrue(session.actor.equals(mockPermissionLevel.actor)) |
38 | | - // assert.isTrue(session.permission.equals(mockPermissionLevel.permission)) |
39 | | - // const result = await session.transact( |
40 | | - // { |
41 | | - // action: { |
42 | | - // authorization: [mockPermissionLevel], |
43 | | - // account: 'eosio.token', |
44 | | - // name: 'transfer', |
45 | | - // data: { |
46 | | - // from: mockPermissionLevel.actor, |
47 | | - // to: 'wharfkittest', |
48 | | - // quantity: '0.0001 EOS', |
49 | | - // memo: 'wharfkit/session wallet plugin template', |
50 | | - // }, |
51 | | - // }, |
52 | | - // }, |
53 | | - // { |
54 | | - // broadcast: false, |
55 | | - // } |
56 | | - // ) |
57 | | - // assert.isTrue(result.signer.equals(mockPermissionLevel)) |
58 | | - // assert.equal(result.signatures.length, 1) |
59 | | - // }) |
60 | | -}) |
| 31 | +// // const kit = new SessionKit(mockSessionKitOptions) |
| 32 | +// // const { session } = await kit.login({ |
| 33 | +// // chain: mockChainDefinition.id, |
| 34 | +// // permissionLevel: mockPermissionLevel, |
| 35 | +// // }) |
| 36 | +// // assert.isTrue(session.chain.equals(mockChainDefinition)) |
| 37 | +// // assert.isTrue(session.actor.equals(mockPermissionLevel.actor)) |
| 38 | +// // assert.isTrue(session.permission.equals(mockPermissionLevel.permission)) |
| 39 | +// // const result = await session.transact( |
| 40 | +// // { |
| 41 | +// // action: { |
| 42 | +// // authorization: [mockPermissionLevel], |
| 43 | +// // account: 'eosio.token', |
| 44 | +// // name: 'transfer', |
| 45 | +// // data: { |
| 46 | +// // from: mockPermissionLevel.actor, |
| 47 | +// // to: 'wharfkittest', |
| 48 | +// // quantity: '0.0001 EOS', |
| 49 | +// // memo: 'wharfkit/session wallet plugin template', |
| 50 | +// // }, |
| 51 | +// // }, |
| 52 | +// // }, |
| 53 | +// // { |
| 54 | +// // broadcast: false, |
| 55 | +// // } |
| 56 | +// // ) |
| 57 | +// // assert.isTrue(result.signer.equals(mockPermissionLevel)) |
| 58 | +// // assert.equal(result.signatures.length, 1) |
| 59 | +// // }) |
| 60 | +// }) |
0 commit comments