worldmap-viewer

git clone https://git.godosa.eu/worldmap-viewer

master

raw · 495 bytes

1
2
3
4
5
6
7
// era-fallback.mjs — run with '#era=nope': an unknown era in the URL falls back to the default with a toast
export const steps = [
  { name: 'unknown era: the default era shows, a toast says so', wait: 3000,
    expect: v => v.era === v.def && /unknown era/i.test(v.toast) && !/era=nope/.test(v.hash),
    js: `const a = window.mapViewer; a.saveUrl();
      return { era: a.meta.era, def: a.meta.default_era, toast: document.getElementById('toast').textContent, hash: location.hash };` },
];