[repo] Merge: main into feature/domi-ui (CPAL-1.0); @domi/ui v1.0.3 vendored (CPAL-1.0) with <DomiCredit /> and the README line
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
// SPDX-License-Identifier: CPAL-1.0
|
||||
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||
|
||||
// The release's screenshots (docs/release.md): every shot's screen is drawn from the demo control
|
||||
// plane alone (each click and wait selector found, no call unanswered), and nothing the demo
|
||||
@@ -10,6 +10,8 @@ import { cleanup, render, waitFor } from "@testing-library/svelte";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import App from "../src/App.svelte";
|
||||
import { app } from "../src/lib/app.svelte";
|
||||
import { DOMI_ATTRIBUTION } from "@domi/ui";
|
||||
import { CREDIT } from "../src/lib/credit";
|
||||
import { SHOTS, demoApi, realLooking } from "./demo";
|
||||
|
||||
let served: { status: number; path: string; text: string | null }[] = [];
|
||||
@@ -54,6 +56,16 @@ describe("realLooking", () => {
|
||||
expect(realLooking("gitea.example.cz and Mark's phone")).toEqual(["gitea.example.cz", "mark"]);
|
||||
expect(realLooking("flowers.stage")).toEqual(["flowers.stage", "flowers"]);
|
||||
});
|
||||
|
||||
it("is the same credit as @domi/ui's, word for word", () => {
|
||||
expect([CREDIT.phrase, CREDIT.url, CREDIT.notice]).toEqual([DOMI_ATTRIBUTION.phrase, DOMI_ATTRIBUTION.url, DOMI_ATTRIBUTION.copyright]);
|
||||
});
|
||||
|
||||
it("leaves out only the licence's credit, exactly as written", () => {
|
||||
expect(realLooking("Built on Domi · Copyright (c) 2026 Marek Novák https://aula.marek-novak.cz")).toEqual([]);
|
||||
expect(realLooking("Marek's server at https://aula.marek-novak.cz/hosts")).toContain("marek");
|
||||
expect(realLooking("files.marek-novak.cz")).toEqual(["files.marek-novak.cz", "marek", "novak"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("the release's screenshots from the demo control plane", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
// SPDX-License-Identifier: CPAL-1.0
|
||||
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||
|
||||
// The demo control plane for the release's screenshots (docs/release.md): control's answers
|
||||
// (docs/api.md) for a small invented home server, built on the click smoke test's stand-in
|
||||
@@ -10,6 +10,7 @@
|
||||
// on any other name or address.
|
||||
|
||||
import { apply, host, mockRoutes, newMock, nowMs, respond, type Route } from "./mockApi";
|
||||
import { CREDIT } from "../src/lib/credit";
|
||||
|
||||
/** One screenshot: the page, the selectors clicked in order, and the selector that means "drawn". */
|
||||
export interface Shot {
|
||||
@@ -277,9 +278,11 @@ const ALLOWED_TLDS = new Set(["test", "example", "invalid"]);
|
||||
const DOC_NETS = ["192.0.2.", "198.51.100.", "203.0.113."];
|
||||
const FORBIDDEN = ["mark", "marek", "novak", "flowers", "esp32", "hyperv"];
|
||||
|
||||
/** What in a text could be real: addresses outside the documentation ranges, names outside .test. */
|
||||
export function realLooking(text: string): string[] {
|
||||
/** What in a text could be real: addresses outside the documentation ranges, names outside .test. The licence's
|
||||
* credit (src/lib/credit.ts, LICENSE Exhibit B) is real on purpose and is the only text left out. */
|
||||
export function realLooking(shown: string): string[] {
|
||||
const found: string[] = [];
|
||||
const text = [CREDIT.url, CREDIT.notice].reduce((t, c) => t.split(c).join(" "), shown);
|
||||
for (const m of text.matchAll(/(?<![\w.])\d{1,3}(?:\.\d{1,3}){3}(?![\w.])/g)) {
|
||||
if (m[0] !== "127.0.0.1" && !DOC_NETS.some((n) => m[0].startsWith(n))) found.push(m[0]);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
// SPDX-License-Identifier: CPAL-1.0
|
||||
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||
|
||||
// The smoke test of every ROADMAP §4 flow with its clicks counted (handoff §4, §15): the real
|
||||
// app against a stand-in for control's API. Typing, focus and waiting are not clicks.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
// SPDX-License-Identifier: CPAL-1.0
|
||||
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||
|
||||
// A stateful stand-in for control's API, shaped like the real answers (docs/api.md), so the
|
||||
// smoke tests can walk every §4 flow and count its clicks. Its builders and routes are also the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
// SPDX-License-Identifier: CPAL-1.0
|
||||
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||
|
||||
// jsdom lacks a few browser features the UI uses.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user