Skip to content

Commit

Permalink
add 'forward' test
Browse files Browse the repository at this point in the history
  • Loading branch information
sometimeskind committed Nov 14, 2017
1 parent 9410c82 commit 664b248
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/browse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,24 @@ describe('multi-step browser test', () => {
expect(mockB.unmount.callCount).to.equals(1);
});

it('moves forward again', async () => {
historystub.forward();

await waitForIO();

expect(appManager._currentAppName).to.equals(guestApps.APP_B.name);

expect(mockA.hydrate.callCount).to.equals(1);
expect(mockA.mount.callCount).to.equals(1);
expect(mockA.onStateChange.callCount).to.equals(0);
expect(mockA.unmount.callCount).to.equals(2);

expect(mockB.hydrate.callCount).to.equals(0);
expect(mockB.mount.callCount).to.equals(2);
expect(mockB.onStateChange.callCount).to.equals(2);
expect(mockB.unmount.callCount).to.equals(1);
});

it('does not mount app scripts in missing slots', async () => {
historystub.pushState({}, null, '/app-c');

Expand All @@ -215,9 +233,9 @@ describe('multi-step browser test', () => {
expect(mockA.unmount.callCount).to.equals(2);

expect(mockB.hydrate.callCount).to.equals(0);
expect(mockB.mount.callCount).to.equals(1);
expect(mockB.mount.callCount).to.equals(2);
expect(mockB.onStateChange.callCount).to.equals(2);
expect(mockB.unmount.callCount).to.equals(1);
expect(mockB.unmount.callCount).to.equals(2);

expect(mockC.hydrate.callCount).to.equals(0);
expect(mockC.mount.callCount).to.equals(0);
Expand Down

0 comments on commit 664b248

Please sign in to comment.