Skip to content

Commit

Permalink
add tests for static directive
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Sep 30, 2017
1 parent 3ab9879 commit ef7fae8
Showing 1 changed file with 59 additions and 59 deletions.
118 changes: 59 additions & 59 deletions test/core/directives/static.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
// describe('Static Directive', function() {
// var staticEl = createTestElement("static", '<h1><span m-static>{{msg}}</span><h1>');
// var span = staticEl.firstChild.firstChild;
//
// var app = new Moon({
// root: "#static",
// data: {
// msg: "Hello Moon!"
// }
// });
//
// it('should initialize with dynamic value', function() {
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not update with dynamic value', function() {
// app.set("msg", "Changed");
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not be present at runtime', function() {
// expect(span.getAttribute("m-static")).to.be['null'];
// });
//
// describe("Nested", function() {
// var staticNestedEl = createTestElement("staticNested", '<h1 m-static><span m-static>{{msg}}</span><h1>');
// var h1 = staticEl.firstChild;
// var span = h1.firstChild;
//
// var app = new Moon({
// root: "#staticNested",
// data: {
// msg: "Hello Moon!"
// }
// });
//
// it('should initialize with dynamic value', function() {
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not update with dynamic value', function() {
// app.set("msg", "Changed");
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not be present at runtime', function() {
// expect(h1.getAttribute("m-static")).to.be['null'];
// expect(span.getAttribute("m-static")).to.be['null'];
// });
// });
// });
describe('Static Directive', function() {
var staticEl = createTestElement("static", '<h1><span m-static>{{msg}}</span><h1>');
var span = staticEl.firstChild.firstChild;

var app = new Moon({
root: "#static",
data: {
msg: "Hello Moon!"
}
});

// it('should initialize with dynamic value', function() {
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not update with dynamic value', function() {
// app.set("msg", "Changed");
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not be present at runtime', function() {
// expect(span.getAttribute("m-static")).to.be['null'];
// });
//
// describe("Nested", function() {
// var staticNestedEl = createTestElement("staticNested", '<h1 m-static><span m-static>{{msg}}</span><h1>');
// var h1 = staticEl.firstChild;
// var span = h1.firstChild;
//
// var app = new Moon({
// root: "#staticNested",
// data: {
// msg: "Hello Moon!"
// }
// });
//
// it('should initialize with dynamic value', function() {
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not update with dynamic value', function() {
// app.set("msg", "Changed");
// return wait(function() {
// expect(span.innerHTML).to.equal("Hello Moon!");
// });
// });
//
// it('should not be present at runtime', function() {
// expect(h1.getAttribute("m-static")).to.be['null'];
// expect(span.getAttribute("m-static")).to.be['null'];
// });
// });
});

0 comments on commit ef7fae8

Please sign in to comment.