Skip to content

Commit 4479c4b

Browse files
author
Evan You
committed
test for v-cloak
1 parent c599bed commit 4479c4b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/specs/directives.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,24 @@ describe('UNIT: Directives', function () {
723723

724724
})
725725

726+
describe('cloak', function () {
727+
728+
it('should remove itself after the instance is ready', function () {
729+
// it doesn't make sense to test with a mock for this one, so...
730+
var v = new Vue({
731+
template: '<div v-cloak></div>',
732+
replace: true,
733+
ready: function () {
734+
// this hook is attached before the v-cloak hook
735+
// so it should still have the attribute
736+
assert.ok(this.$el.hasAttribute('v-cloak'))
737+
}
738+
})
739+
assert.notOk(v.$el.hasAttribute('v-cloak'))
740+
})
741+
742+
})
743+
726744
})
727745

728746
function mockDirective (dirName, tag, type) {

0 commit comments

Comments
 (0)