-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathCanisterConfigureMethodCallList.spec.ts
More file actions
47 lines (40 loc) · 1.39 KB
/
CanisterConfigureMethodCallList.spec.ts
File metadata and controls
47 lines (40 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Principal } from '@icp-sdk/core/principal';
import { describe, expect, it } from 'vitest';
import { mount } from '~/test.utils';
import CanisterConfigureMethodCallList from './CanisterConfigureMethodCallList.vue';
describe('CanisterConfigureMethodCallList', () => {
it('default shows empty list', () => {
const canisterId = Principal.fromText('r7inp-6aaaa-aaaaa-aaabq-cai');
const form = mount(CanisterConfigureMethodCallList, {
props: {
canisterId,
},
});
const noMethodSection = form.find('[data-test-id="empty-method-list"]');
expect(noMethodSection.exists()).toBe(true);
});
it('shows method list', async () => {
const canisterId = Principal.fromText('r7inp-6aaaa-aaaaa-aaabq-cai');
const form = mount(CanisterConfigureMethodCallList, {
props: {
canisterId,
permissions: [
{
execution_method: 'test',
validation_method: { No: null },
allow: {
auth_scope: { Restricted: null },
user_groups: [],
users: [],
},
},
],
},
});
await form.vm.$nextTick();
const noMethodSection = form.find('[data-test-id="empty-method-list"]');
const methodList = form.find('[data-test-id="method-list"]');
expect(noMethodSection.exists()).toBe(false);
expect(methodList.exists()).toBe(true);
});
});