-
-
Notifications
You must be signed in to change notification settings - Fork 374
/
attr-value-empty.spec.js
33 lines (26 loc) · 1.12 KB
/
attr-value-empty.spec.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
/**
* Copyright (c) 2013, Yanis Wang <yanis.wang@gmail.com>
* MIT Licensed
*/
var expect = require("expect.js");
var HTMLHint = require("../../index").HTMLHint;
describe('Rules: attr-value-empty', function(){
it('Attribute value have no value should result in an error', function(){
var code = '<input disabled>';
var messages = HTMLHint.verify(code, {'attr-value-empty': true});
expect(messages.length).to.be(1);
expect(messages[0].rule.id).to.be('attr-value-empty');
expect(messages[0].line).to.be(1);
expect(messages[0].col).to.be(7);
});
it('Attribute value closed by quote but no value should not result in an error', function(){
var code = '<input disabled="">';
var messages = HTMLHint.verify(code, {'attr-value-empty': true});
expect(messages.length).to.be(0);
});
it('Attribute value closed by quote and have value should not result in an error', function(){
var code = '<input disabled="disabled">';
var messages = HTMLHint.verify(code, {'attr-value-empty': true});
expect(messages.length).to.be(0);
});
});