Skip to content

Commit 340fec7

Browse files
ezhloboadrienverge
authored andcommitted
Add failed test case when using ellipsis in attribute names
1 parent de14b7f commit 340fec7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/rules/validate-attribute-separator.test.js

+17
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ function createTest(linter, fixturesPath) {
3535
linter.checkString('input(*ngIf=\'editing\' type=\'text\' name=\'name\' value=\'value\')');
3636
}, /Invalid regular expression/);
3737
});
38+
39+
describe('with ellipsis mark in name', () => {
40+
it('reports invalid attribute separator', () => {
41+
const result = linter.checkString('input(type=\'text\' ...props name=\'name\')');
42+
43+
assert.equal(result.length, 1);
44+
assert.equal(result[0].code, 'PUG:LINT_VALIDATEATTRIBUTESEPARATOR');
45+
assert.equal(result[0].line, 1);
46+
assert.equal(result[0].column, 18);
47+
});
48+
49+
it('does not report with valid separator', function () {
50+
const result = linter.checkString('input(...props type=\'text\' ...props name=\'name\' value=\'value\' ...props)');
51+
52+
assert.equal(result.length, 0);
53+
});
54+
});
3855
});
3956

4057
describe('comma', function () {

0 commit comments

Comments
 (0)