-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9fa63e
commit 15f9fcd
Showing
2 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { assert } from 'chai'; | ||
import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; | ||
|
||
describe('The Aurelia HTML syntax view-spy attribute', () => { | ||
|
||
it('must tokenize view-spy attribute with scope "view-spy.attribute.html.au"', () => { | ||
|
||
// arrange | ||
let scope = 'view-spy.attribute.html.au'; | ||
|
||
// act | ||
let lineToken = tokenizeLine('<p view-spy foo="boo">'); | ||
|
||
// assert | ||
let token = getTokenOnCharRange(lineToken, 3, 11); | ||
assert.isOk(hasScope(token.scopes, scope)); | ||
|
||
}); | ||
|
||
it('must not tokenize view-spy="" attribute', () => { | ||
|
||
// arrange | ||
let scope = 'view-spy.attribute.html.au'; | ||
|
||
// act | ||
let lineToken = tokenizeLine('<p view-spy="">'); | ||
|
||
// assert | ||
let token = getTokenOnCharRange(lineToken, 3, 11); | ||
assert.isDefined(token); | ||
assert.isNotOk(hasScope(token.scopes, scope)); | ||
|
||
}); | ||
|
||
it('must not tokenize view-spy-foo="" attribute', () => { | ||
|
||
// arrange | ||
let scope = 'view-spy.attribute.html.au'; | ||
|
||
// act | ||
let lineToken = tokenizeLine('<p view-spy-foo="">'); | ||
|
||
// assert | ||
let token = getTokenOnCharRange(lineToken, 3, 15); | ||
assert.isDefined(token); | ||
assert.isNotOk(hasScope(token.scopes, scope)); | ||
|
||
}); | ||
|
||
it('must not tokenize foo-containerles="" attribute', () => { | ||
|
||
// arrange | ||
let scope = 'view-spy.attribute.html.au'; | ||
|
||
// act | ||
let lineToken = tokenizeLine('<p foo-view-spy="">'); | ||
|
||
// assert | ||
let token = getTokenOnCharRange(lineToken, 3, 15); | ||
assert.isDefined(token); | ||
assert.isNotOk(hasScope(token.scopes, scope)); | ||
|
||
}); | ||
|
||
it('must not tokenize foo-view-spy="boo" attribute', () => { | ||
|
||
// arrange | ||
let scope = 'view-spy.attribute.html.au'; | ||
|
||
// act | ||
let lineToken = tokenizeLine('<p foo-view-spy="boo">'); | ||
|
||
// assert | ||
let token = getTokenOnCharRange(lineToken, 3, 15); | ||
assert.isDefined(token); | ||
assert.isNotOk(hasScope(token.scopes, scope)); | ||
|
||
}); | ||
|
||
it('must not tokenize view-spyfoo="boo" attribute', () => { | ||
|
||
// arrange | ||
let scope = 'view-spy.attribute.html.au'; | ||
|
||
// act | ||
let lineToken = tokenizeLine('<p view-spyfoo="boo">'); | ||
|
||
// assert | ||
let token = getTokenOnCharRange(lineToken, 3, 14); | ||
assert.isDefined(token); | ||
assert.isNotOk(hasScope(token.scopes, scope)); | ||
|
||
}); | ||
}); |