Fix onunload test case

- the previous test only remove last item on array, but expect all
subcomponent's onunload to be called. This PR change it by clear that
array.
- uncomment previous test case that marked fail.
This commit is contained in:
Syaiful Bahri 2015-12-29 09:58:26 +07:00
parent 5003c0ac23
commit 795f098404

View file

@ -333,12 +333,11 @@ describe("m.mount()", function () {
})
}))
list.pop()
list = []
refresh(true)
// TODO: These fail.
// expect(spies[1]).to.have.been.called
// expect(spies[2]).to.have.been.called
expect(spies[1]).to.have.been.called
expect(spies[2]).to.have.been.called
expect(spies[3]).to.have.been.called
})
@ -374,17 +373,15 @@ describe("m.mount()", function () {
})
}))
list.pop()
list = []
refresh(true)
// TODO: These fail.
// expect(spies1[1]).to.have.been.called
// expect(spies1[2]).to.have.been.called
expect(spies1[1]).to.have.been.called
expect(spies1[2]).to.have.been.called
expect(spies1[3]).to.have.been.called
// TODO: These fail.
// expect(spies2[1]).to.have.been.called
// expect(spies2[2]).to.have.been.called
expect(spies2[1]).to.have.been.called
expect(spies2[2]).to.have.been.called
expect(spies2[3]).to.have.been.called
})