Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app-route.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
__resetProperties: function() {
this._setActive(false);
this._matched = null;
this.data = {};
},

__tryToMatch: function() {
Expand Down
10 changes: 5 additions & 5 deletions test/app-route.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@

route.pattern = '/user/:username/likes/:count';

// At the moment, we don't reset data when we no longer match.
expect(route.data).to.be.deep.equal({username: 'sans'});
// The data should reset when we no longer match.
expect(route.data).to.be.deep.equal({});
expect(route.active).to.be.equal(false);

route.set('route.path', "/does/not/match");

expect(route.data).to.be.deep.equal({username: 'sans'});
expect(route.data).to.be.deep.equal({});
expect(route.active).to.be.equal(false);

route.set('route.path', '/user/undyne/likes/20');
Expand Down Expand Up @@ -235,13 +235,13 @@
expect(routes.baz.data).to.be.eql({});
});

test('chained route state is untouched when deactivated', function() {
test('chained route state is cleared when deactivated', function() {
var routes = fixtureChainedRoutes({ path: '/foo/123/bar/abc' });

routes.foo.set('route.path', '/foo/321/baz/zyx');

expect(routes.foo.data).to.be.eql({ foo: '321' });
expect(routes.bar.data).to.be.eql({ bar: 'abc' });
expect(routes.bar.data).to.be.eql({});
expect(routes.baz.data).to.be.eql({ baz: 'zyx' });
});

Expand Down