-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
39 lines (36 loc) · 987 Bytes
/
index.test.js
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
const { onComplete } = require('./index');
function createSimplePath(tagName, attributeName) {
const astPath = {
node: {
type: 'TextNode'
},
parent: {
type: 'AttrNode',
name: attributeName
},
parentPath: {
parent: {
tag: tagName
}
}
}
return astPath;
}
describe('[role] attribute autocomplete', () => {
it('should autocomplete role for [button] tag', () => {
expect(onComplete('', {
results: [],
type: 'template',
focusPath: createSimplePath('button', 'role')
})).toMatchSnapshot();
})
});
describe('[aria] attribute autocomplete', () => {
it('should autocomplete [aria-dropeffect]', () => {
expect(onComplete('', {
results: [],
type: 'template',
focusPath: createSimplePath('ul', 'aria-dropeffect')
})).toMatchSnapshot();
})
})