Skip to content

Commit

Permalink
Update test for reset() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmacarthur committed Apr 12, 2018
1 parent b1ee9a1 commit 7915088
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/base.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ test("Returns an object with base properties.", () => {
});

test("Successfully resets when called.", () => {
jest.useFakeTimers();

document.body.innerHTML = `<div>'
<span id="element"></span>
</div>`;
Expand All @@ -55,10 +57,17 @@ test("Successfully resets when called.", () => {
strings: "This is my string!"
});

jest.runAllTimers();

instance.destroy();

expect(instance.isComplete).toBe(true);
expect(instance.hasBeenDestroyed).toBe(true);

instance.reset();

expect(instance.instances).toHaveLength(1);
expect(instance.isComplete).toBe(false);
expect(instance.hasBeenDestroyed).toBe(false);
});

Expand Down

0 comments on commit 7915088

Please sign in to comment.