mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-19 22:05:20 +00:00
Checking the current_branch[i] route match against the current request's route match.
current_branch[i].match.slice(1, i+2) compared to match.slice(1, i+2) Fixes https://github.com/sveltejs/sapper/issues/688
This commit is contained in:
@@ -23,7 +23,8 @@ describe('layout', function() {
|
||||
assert.deepEqual(text1.split('\n').map(str => str.trim()).filter(Boolean), [
|
||||
'y: bar 1',
|
||||
'z: baz 1',
|
||||
'click me',
|
||||
'goto foo/bar/qux',
|
||||
'goto foo/abc/def',
|
||||
'child segment: baz'
|
||||
]);
|
||||
|
||||
@@ -32,7 +33,8 @@ describe('layout', function() {
|
||||
assert.deepEqual(text2.split('\n').map(str => str.trim()).filter(Boolean), [
|
||||
'y: bar 1',
|
||||
'z: baz 1',
|
||||
'click me',
|
||||
'goto foo/bar/qux',
|
||||
'goto foo/abc/def',
|
||||
'child segment: baz'
|
||||
]);
|
||||
|
||||
@@ -43,9 +45,22 @@ describe('layout', function() {
|
||||
assert.deepEqual(text3.split('\n').map(str => str.trim()).filter(Boolean), [
|
||||
'y: bar 1',
|
||||
'z: qux 2',
|
||||
'click me',
|
||||
'goto foo/bar/qux',
|
||||
'goto foo/abc/def',
|
||||
'child segment: qux'
|
||||
]);
|
||||
|
||||
await r.page.click('[href="foo/abc/def"]');
|
||||
await r.wait();
|
||||
|
||||
const text4 = await r.text('#sapper');
|
||||
assert.deepEqual(text4.split('\n').map(str => str.trim()).filter(Boolean), [
|
||||
'y: abc 2',
|
||||
'z: def 3',
|
||||
'goto foo/bar/qux',
|
||||
'goto foo/abc/def',
|
||||
'child segment: def'
|
||||
]);
|
||||
});
|
||||
|
||||
it('survives the tests with no server errors', () => {
|
||||
|
||||
Reference in New Issue
Block a user