oficina / mapa Public

Clone
git clone https://amadan.net/oficina/mapa

Plain git — no account needed to clone.

Download

Download this file

1package mapatest
2
3import (
4 "strings"
5 "testing"
6)
7
8// Insert → Date… (level-up build note 83) sits beside Today's date where
9// the page editor runs, and opens its date picker; the Markdown screen
10// has no picker, so it is not drawn there. Today's date stays on both.
11func TestInsertOffersDateBesideTodaysDate(t *testing.T) {
12 rig := newRig(t)
13 acme := rig.createPage(t, Ana, "Acme", "One.")
14 const today = `data-mapa-command="insert-date" disabled>` +
15 `<span estilo-menu-label>Today&#39;s date</span>`
16 const pick = `data-mapa-command="insert-date-pick" disabled>` +
17 `<span estilo-menu-label>Date…</span>`
18 for _, path := range []string{"/d/2026-11-20", acme} {
19 insert := between(rig.getWith(Ana, path), `id="mapa-menu-insert"`,
20 `</details>`)
21 inOrder(t, path, insert, today, pick)
22 }
23 insert := between(rig.getWith(Ana, "/d/2026-11-20/edit"),
24 `id="mapa-menu-insert"`, `</details>`)
25 if !strings.Contains(insert, today) ||
26 strings.Contains(insert, "insert-date-pick") {
27 t.Fatalf("the Markdown screen's Insert:\n%s", insert)
28 }
29}
30