Make the mobile Agenda addressable and Back-safe #694
|
|
@ -6,7 +6,7 @@
|
|||
'use strict';
|
||||
|
||||
const repositoryPart = /^[A-Za-z0-9_.-]+$/;
|
||||
const queueFilters = ['today', 'attention', 'update', 'later', 'draft'];
|
||||
const queueFilters = ['today', 'agenda', 'attention', 'update', 'later', 'draft'];
|
||||
|
||||
function positiveInteger(value) {
|
||||
const number = Number(value);
|
||||
|
|
|
|||
|
|
@ -659,12 +659,12 @@ process.stdout.write(JSON.stringify({{calls, hash:location.hash, parsed:routes.p
|
|||
def test_every_mobile_queue_route_survives_hydration_and_detail_back_navigation():
|
||||
script = f"""
|
||||
const routes = require({json.dumps(str(WORK_ROUTE))});
|
||||
const canonical = ['today', 'attention', 'updates', 'later', 'drafts'];
|
||||
const canonical = ['today', 'agenda', 'attention', 'updates', 'later', 'drafts'];
|
||||
const parsed = canonical.map(name => [name, routes.parse('#/my-work/' + name)]);
|
||||
const listeners = {{}};
|
||||
const location = {{hash:'#/my-work/later'}};
|
||||
const location = {{hash:'#/my-work/agenda'}};
|
||||
const calls = [];
|
||||
const stack = ['#/my-work/later'];
|
||||
const stack = ['#/my-work/agenda'];
|
||||
let cursor = 0;
|
||||
const history = {{
|
||||
pushState(state, _, hash) {{ stack.splice(cursor + 1); stack.push(hash); cursor += 1; location.hash = hash; }},
|
||||
|
|
@ -693,16 +693,17 @@ process.stdout.write(JSON.stringify({{parsed, calls, hash:location.hash}}));
|
|||
assert json.loads(result.stdout) == {
|
||||
"parsed": [
|
||||
["today", {"kind": "queue", "filter": "today"}],
|
||||
["agenda", {"kind": "queue", "filter": "agenda"}],
|
||||
["attention", {"kind": "queue", "filter": "attention"}],
|
||||
["updates", {"kind": "queue", "filter": "update"}],
|
||||
["later", {"kind": "queue", "filter": "later"}],
|
||||
["drafts", {"kind": "queue", "filter": "draft"}],
|
||||
],
|
||||
"calls": [
|
||||
["queue", "later"],
|
||||
["queue", "agenda"],
|
||||
["open", 42],
|
||||
["close"],
|
||||
["queue", "later"],
|
||||
["queue", "agenda"],
|
||||
["queue", "draft"],
|
||||
],
|
||||
"hash": "#/my-work/drafts",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user