[ui] DaySentence: Her folded petal, the words and their source; the library bundled after validation
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
"description": "The PWA. Renders what the engine returns; contains no growth, taming or sky logic.",
|
"description": "The PWA. Renders what the engine returns; contains no growth, taming or sky logic.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host 127.0.0.1 --port 5173 --strictPort",
|
"dev": "vite --host 127.0.0.1 --port 5173 --strictPort",
|
||||||
"build": "vite build",
|
"build": "tsx ../../scripts/validate-library.ts && vite build",
|
||||||
"typecheck": "svelte-check --threshold error --output human"
|
"typecheck": "svelte-check --threshold error --output human"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
import { version } from '../package.json';
|
import { version } from '../package.json';
|
||||||
// Bundled at build time, so the letter is precached and opens offline (letter-slot.md L1).
|
// Bundled at build time, so the letter is precached and opens offline (letter-slot.md L1).
|
||||||
import letter from '../../../docs/LETTER.md?raw';
|
import letter from '../../../docs/LETTER.md?raw';
|
||||||
|
// The verified hope library, bundled after validate:library passed (day-sentence.md P5).
|
||||||
|
import sentences from 'virtual:rosea-library';
|
||||||
|
|
||||||
// The device's own zone, read here and nowhere else: the engine never asks the
|
// The device's own zone, read here and nowhere else: the engine never asks the
|
||||||
// device anything (CLAUDE.md §2). Only the zone's name; never GPS, never a lookup.
|
// device anything (CLAUDE.md §2). Only the zone's name; never GPS, never a lookup.
|
||||||
@@ -92,6 +94,9 @@
|
|||||||
await storage.appendCare(event);
|
await storage.appendCare(event);
|
||||||
keepAfterCare();
|
keepAfterCare();
|
||||||
},
|
},
|
||||||
|
sentences,
|
||||||
|
loadOpened: () => storage.loadOpened(),
|
||||||
|
appendOpened: (event) => storage.appendOpened(event),
|
||||||
clientVersion: version,
|
clientVersion: version,
|
||||||
deviceZone,
|
deviceZone,
|
||||||
now: () => Date.now(),
|
now: () => Date.now(),
|
||||||
|
|||||||
Vendored
+7
@@ -1,3 +1,10 @@
|
|||||||
/// <reference types="svelte" />
|
/// <reference types="svelte" />
|
||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
/// <reference types="vite-plugin-pwa/client" />
|
/// <reference types="vite-plugin-pwa/client" />
|
||||||
|
|
||||||
|
declare module 'virtual:rosea-library' {
|
||||||
|
import type { HopeSentence } from '@rosea/schema';
|
||||||
|
/** The verified hope library, bundled at build time after validate:library passed (day-sentence.md P5). */
|
||||||
|
const library: readonly HopeSentence[];
|
||||||
|
export default library;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
import { readdirSync, readFileSync } from 'node:fs';
|
||||||
|
import { join, resolve } from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
import { defineConfig, type Plugin } from 'vite';
|
import { defineConfig, type Plugin } from 'vite';
|
||||||
import { VitePWA } from 'vite-plugin-pwa';
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
// A relative path, not '@rosea/schema', on purpose. Vite bundles a config's
|
// A relative path, not '@rosea/schema', on purpose. Vite bundles a config's
|
||||||
@@ -55,12 +58,43 @@ function contentSecurityPolicy(): Plugin {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The hope library, bundled at build time as `virtual:rosea-library`
|
||||||
|
* (day-sentence.md P5). The build script runs `validate:library` first and stops if
|
||||||
|
* it fails, so the app holds exactly what passed and never validates in the browser
|
||||||
|
* (GAP_ANALYSIS G0.12: Ajv needs `new Function`, which the CSP forbids).
|
||||||
|
* `ROSEA_LIBRARY_DIR` swaps the folder, for the e2e build only.
|
||||||
|
*/
|
||||||
|
const LIBRARY_DIR = resolve(fileURLToPath(new URL('../..', import.meta.url)), process.env['ROSEA_LIBRARY_DIR'] ?? 'content/library');
|
||||||
|
|
||||||
|
function hopeLibrary(): Plugin {
|
||||||
|
const id = 'virtual:rosea-library';
|
||||||
|
const resolved = `\0${id}`;
|
||||||
|
return {
|
||||||
|
name: 'rosea-library',
|
||||||
|
resolveId: (source) => (source === id ? resolved : undefined),
|
||||||
|
load(source) {
|
||||||
|
if (source !== resolved) return undefined;
|
||||||
|
const entries: unknown[] = [];
|
||||||
|
for (const file of readdirSync(LIBRARY_DIR).filter((f) => f.endsWith('.json')).sort()) {
|
||||||
|
const path = join(LIBRARY_DIR, file);
|
||||||
|
this.addWatchFile(path);
|
||||||
|
const data: unknown = JSON.parse(readFileSync(path, 'utf8'));
|
||||||
|
if (!Array.isArray(data)) throw new Error(`${path}: must be an array of entries`);
|
||||||
|
entries.push(...data);
|
||||||
|
}
|
||||||
|
return `export default ${JSON.stringify(entries)};`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Nothing binds to anything but 127.0.0.1 (CLAUDE.md §5.7).
|
// Nothing binds to anything but 127.0.0.1 (CLAUDE.md §5.7).
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: BASE,
|
base: BASE,
|
||||||
plugins: [
|
plugins: [
|
||||||
svelte(),
|
svelte(),
|
||||||
contentSecurityPolicy(),
|
contentSecurityPolicy(),
|
||||||
|
hopeLibrary(),
|
||||||
VitePWA({
|
VitePWA({
|
||||||
strategies: 'generateSW',
|
strategies: 'generateSW',
|
||||||
// Never swap a running app silently. A new worker waits until the player
|
// Never swap a running app silently. A new worker waits until the player
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "e2e-first",
|
||||||
|
"text": { "en": "An e2e fixture sentence, not a real one." },
|
||||||
|
"source": { "work": "Fixture 1", "author": null, "tradition": "fixture", "translation": null, "publicDomain": true, "verifiedBy": "e2e", "verifiedAt": "2026-11-01" },
|
||||||
|
"use": ["sunset"],
|
||||||
|
"tone": "gentle",
|
||||||
|
"promisesOutcome": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "e2e-second",
|
||||||
|
"text": { "en": "A second e2e fixture sentence." },
|
||||||
|
"source": { "work": "Fixture 2", "author": "A Writer", "tradition": "fixture", "translation": null, "publicDomain": true, "verifiedBy": "e2e", "verifiedAt": "2026-11-01" },
|
||||||
|
"use": ["sunset"],
|
||||||
|
"tone": "gentle",
|
||||||
|
"promisesOutcome": false
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import AxeBuilder from '@axe-core/playwright';
|
||||||
|
import { expect, test, type Page } from '@playwright/test';
|
||||||
|
import { en } from '@rosea/ui/copy';
|
||||||
|
import { execSync } from 'node:child_process';
|
||||||
|
import { mkdtempSync, rmSync } from 'node:fs';
|
||||||
|
import { tmpdir } from 'node:os';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { startStaticServer, type StaticServer } from './static-server.js';
|
||||||
|
import { storedCare } from './stored.js';
|
||||||
|
import fixture from './fixtures/library/fixture.json' with { type: 'json' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The rose's folded petal (.agents/features/day-sentence.md), in the BUILT app.
|
||||||
|
*
|
||||||
|
* The shipped library is empty until the author verifies sentences, so the main
|
||||||
|
* build can only show that there is no petal. This spec also builds the app a second
|
||||||
|
* time, with a fixture library (ROSEA_LIBRARY_DIR, P5), into a folder of its own, and
|
||||||
|
* serves that. The second build passes through the same validate:library step.
|
||||||
|
*/
|
||||||
|
const ROOT = fileURLToPath(new URL('..', import.meta.url));
|
||||||
|
const MORNING = Date.parse('2026-03-01T10:00:00+01:00');
|
||||||
|
const texts = fixture.map((s) => s.text.en);
|
||||||
|
|
||||||
|
test.use({ timezoneId: 'Europe/Prague', locale: 'en-US' });
|
||||||
|
|
||||||
|
let server: StaticServer;
|
||||||
|
test.beforeEach(async () => {
|
||||||
|
server = await startStaticServer();
|
||||||
|
});
|
||||||
|
test.afterEach(async () => {
|
||||||
|
await server.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function open(page: Page): Promise<void> {
|
||||||
|
await page.clock.setFixedTime(MORNING);
|
||||||
|
await page.goto(server.url);
|
||||||
|
await expect(page.getByRole('button', { name: en.rose.water })).toBeVisible();
|
||||||
|
}
|
||||||
|
|
||||||
|
test('with the shipped library still empty, she holds no petal and says nothing about one', async ({ page }) => {
|
||||||
|
await open(page);
|
||||||
|
await expect(page.getByRole('button', { name: en.rose.petal.open })).toHaveCount(0);
|
||||||
|
await expect(page.getByText(en.rose.petal.waiting)).toHaveCount(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('with a fixture library', () => {
|
||||||
|
let dist: string;
|
||||||
|
test.beforeAll(() => {
|
||||||
|
dist = mkdtempSync(join(tmpdir(), 'rosea-petal-'));
|
||||||
|
// The same build the player gets, with the fixture library in place of the real one.
|
||||||
|
execSync(`pnpm --filter @rosea/app run build --outDir "${dist}" --emptyOutDir`, {
|
||||||
|
cwd: ROOT,
|
||||||
|
env: { ...process.env, ROSEA_LIBRARY_DIR: 'e2e/fixtures/library' },
|
||||||
|
stdio: 'pipe'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
test.afterAll(() => {
|
||||||
|
rmSync(dist, { recursive: true, force: true });
|
||||||
|
});
|
||||||
|
test.beforeEach(() => server.serveFrom(dist));
|
||||||
|
|
||||||
|
test('open her petal: the words and their source; a reload keeps it open, and no second one today', async ({ page }) => {
|
||||||
|
await open(page);
|
||||||
|
await page.getByRole('button', { name: en.rose.petal.open }).click();
|
||||||
|
const words = page.locator('blockquote');
|
||||||
|
await expect(words).toHaveCount(1);
|
||||||
|
const said = (await words.textContent()) ?? '';
|
||||||
|
expect(texts).toContain(said);
|
||||||
|
|
||||||
|
await storedCare(page, 1);
|
||||||
|
await page.reload();
|
||||||
|
await expect(page.getByRole('button', { name: en.rose.petal.today })).toHaveAttribute('aria-expanded', 'true');
|
||||||
|
await expect(page.locator('blockquote')).toHaveText(said);
|
||||||
|
await expect(page.getByRole('button', { name: en.rose.petal.open })).toHaveCount(0);
|
||||||
|
|
||||||
|
// Tomorrow, the next one is folded.
|
||||||
|
await page.clock.setFixedTime(MORNING + 24 * 3_600_000);
|
||||||
|
await page.reload();
|
||||||
|
await expect(page.getByRole('button', { name: en.rose.petal.open })).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('the folded and the open petal have no accessibility violations', async ({ page }) => {
|
||||||
|
await open(page);
|
||||||
|
await expect(page.getByRole('button', { name: en.rose.petal.open })).toBeVisible();
|
||||||
|
expect((await new AxeBuilder({ page }).analyze()).violations.map((v) => `${v.id}: ${v.help}`)).toEqual([]);
|
||||||
|
await page.getByRole('button', { name: en.rose.petal.open }).click();
|
||||||
|
await expect(page.locator('blockquote')).toBeVisible();
|
||||||
|
expect((await new AxeBuilder({ page }).analyze()).violations.map((v) => `${v.id}: ${v.help}`)).toEqual([]);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -7,7 +7,7 @@ import { defineConfig, devices } from '@playwright/test';
|
|||||||
*/
|
*/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: '.',
|
testDir: '.',
|
||||||
testMatch: /(shell|update)\.spec\.ts/,
|
testMatch: /(shell|update|petal)\.spec\.ts/,
|
||||||
fullyParallel: false,
|
fullyParallel: false,
|
||||||
workers: 1,
|
workers: 1,
|
||||||
retries: 0,
|
retries: 0,
|
||||||
|
|||||||
+1
-1
@@ -253,7 +253,7 @@ test.describe('keep her safe, in Prague at 08:00 on 1 March 2026', () => {
|
|||||||
} finally {
|
} finally {
|
||||||
await first.close();
|
await first.close();
|
||||||
}
|
}
|
||||||
expect(JSON.parse(saved)).toMatchObject({ format: 'rosea-rose', version: 1 });
|
expect(JSON.parse(saved)).toMatchObject({ format: 'rosea-rose', version: 2 });
|
||||||
expect(saved).not.toMatch(/Brno|privateKey/);
|
expect(saved).not.toMatch(/Brno|privateKey/);
|
||||||
|
|
||||||
// A fresh profile: the shape of an evicted garden, or a new phone.
|
// A fresh profile: the shape of an evicted garden, or a new phone.
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
<h1 bind:this={heading} tabindex="-1">{PRODUCT_NAME}</h1>
|
<h1 bind:this={heading} tabindex="-1">{PRODUCT_NAME}</h1>
|
||||||
<p>{en.shell.preparing}</p>
|
<p>{en.shell.preparing}</p>
|
||||||
{#if rose}
|
{#if rose}
|
||||||
<Rose wiring={rose} timeZone={roseZone} />
|
<Rose wiring={rose} timeZone={roseZone} {place} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if sunset && (status === 'asking' || changing)}
|
{#if sunset && (status === 'asking' || changing)}
|
||||||
<SunsetPlace
|
<SunsetPlace
|
||||||
|
|||||||
@@ -50,6 +50,24 @@ export const en = {
|
|||||||
tooFull: 'That was a lot of water. I will be fine by tomorrow.'
|
tooFull: 'That was a lot of water. I will be fine by tomorrow.'
|
||||||
},
|
},
|
||||||
notKept: 'This device could not keep today’s care, so it lasts only until the garden closes.',
|
notKept: 'This device could not keep today’s care, so it lasts only until the garden closes.',
|
||||||
|
/**
|
||||||
|
* The day's sentence (day-sentence.md). She offers; she never counts, and never
|
||||||
|
* mentions a day the petal was not opened.
|
||||||
|
*/
|
||||||
|
petal: {
|
||||||
|
/** Said when she needs nothing else. */
|
||||||
|
waiting: 'I am keeping a folded petal for you.',
|
||||||
|
/** Around the real sunset (P4); in polar day and night the same words still hold. */
|
||||||
|
goodMoment: 'The sun is low now. Would you open my petal?',
|
||||||
|
/** After opening it at the good moment: the best moments send the player outside. */
|
||||||
|
lookUp: 'Go and look at the sky. I will be here.',
|
||||||
|
open: 'Open her petal',
|
||||||
|
folded: 'A folded petal.',
|
||||||
|
today: 'Today’s petal',
|
||||||
|
remember: 'Do you remember this one?',
|
||||||
|
source: (work: string, author: string | null, translation: string | null): string =>
|
||||||
|
`${author ? `${author}, ` : ''}${work}${translation ? ` (${translation})` : ''}`
|
||||||
|
},
|
||||||
/** Keeping her (keep-her-safe.md). True and calm: a browser can clear a site's data. */
|
/** Keeping her (keep-her-safe.md). True and calm: a browser can clear a site's data. */
|
||||||
safe: {
|
safe: {
|
||||||
title: 'Keep her safe',
|
title: 'Keep her safe',
|
||||||
@@ -62,7 +80,8 @@ export const en = {
|
|||||||
save: 'Save her to a file',
|
save: 'Save her to a file',
|
||||||
fileNote: 'The file holds her care and when it was given. It never holds your town.',
|
fileNote: 'The file holds her care and when it was given. It never holds your town.',
|
||||||
bringBack: 'Bring her back from a file',
|
bringBack: 'Bring her back from a file',
|
||||||
broughtBack: (n: number): string => (n === 1 ? 'She is back, with 1 act of care.' : `She is back, with ${n} acts of care.`),
|
broughtBack: (n: number): string =>
|
||||||
|
n === 0 ? 'She is back.' : n === 1 ? 'She is back, with 1 act of care.' : `She is back, with ${n} acts of care.`,
|
||||||
alreadyHere: 'Everything in that file is already here.',
|
alreadyHere: 'Everything in that file is already here.',
|
||||||
notARose: 'That file does not hold a rose.'
|
notARose: 'That file does not hold a rose.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
const file = input.files?.[0];
|
const file = input.files?.[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
try {
|
try {
|
||||||
const { added } = await wiring.importRose(JSON.parse(await file.text()), currentKey);
|
const { added, petals } = await wiring.importRose(JSON.parse(await file.text()), currentKey);
|
||||||
said = added === 0 ? en.rose.safe.alreadyHere : en.rose.safe.broughtBack(added);
|
said = added === 0 && petals === 0 ? en.rose.safe.alreadyHere : en.rose.safe.broughtBack(added);
|
||||||
onrestored();
|
onrestored();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// A wrong file is an ordinary thing to choose; the player is told calmly, the console fully.
|
// A wrong file is an ordinary thing to choose; the player is told calmly, the console fully.
|
||||||
|
|||||||
@@ -0,0 +1,128 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { PetalNow } from '@rosea/engine';
|
||||||
|
import type { HopeSentence } from '@rosea/schema';
|
||||||
|
import { tick } from 'svelte';
|
||||||
|
import { en } from '../copy/en.js';
|
||||||
|
// The art board's stand-in until real art is accepted (docs/ART.md).
|
||||||
|
import folded from '../../../../art/placeholders/petal-folded.svg?url';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The rose's folded petal (day-sentence.md). The engine decides which sentence and
|
||||||
|
* whether it is open; this shows it and hands the player's tap back.
|
||||||
|
*/
|
||||||
|
let { petal, sentences, onopen }: { petal: PetalNow; sentences: readonly HopeSentence[]; onopen: () => void } = $props();
|
||||||
|
|
||||||
|
const uid = $props.id();
|
||||||
|
/** Today's open petal is shown; the player can fold it away and back for the rest of the day. */
|
||||||
|
let showing = $state(true);
|
||||||
|
let words = $state<HTMLElement>();
|
||||||
|
|
||||||
|
const find = (id: string | null): HopeSentence | undefined => (id === null ? undefined : sentences.find((s) => s.id === id));
|
||||||
|
const today = $derived(petal.kind === 'open' ? find(petal.id) : undefined);
|
||||||
|
const remembered = $derived(petal.kind === 'open' ? find(petal.remembered) : undefined);
|
||||||
|
const source = (s: HopeSentence): string => en.rose.petal.source(s.source.work, s.source.author, s.source.translation);
|
||||||
|
|
||||||
|
async function open(): Promise<void> {
|
||||||
|
onopen();
|
||||||
|
showing = true;
|
||||||
|
// The player acted, so focus follows them to the words.
|
||||||
|
await tick();
|
||||||
|
words?.focus();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if petal.kind === 'folded'}
|
||||||
|
<div class="petal">
|
||||||
|
<img src={folded} alt={en.rose.petal.folded} width="56" height="56" />
|
||||||
|
<button type="button" onclick={open}>{en.rose.petal.open}</button>
|
||||||
|
</div>
|
||||||
|
{:else if petal.kind === 'open' && today}
|
||||||
|
<div class="petal">
|
||||||
|
<button type="button" class="quiet" aria-expanded={showing} aria-controls="{uid}-words" onclick={() => (showing = !showing)}>{en.rose.petal.today}</button>
|
||||||
|
{#if showing}
|
||||||
|
<div id="{uid}-words" class="words" tabindex="-1" bind:this={words}>
|
||||||
|
<figure>
|
||||||
|
<blockquote>{today.text.en}</blockquote>
|
||||||
|
<figcaption>{source(today)}</figcaption>
|
||||||
|
</figure>
|
||||||
|
{#if remembered}
|
||||||
|
<p class="remember">{en.rose.petal.remember}</p>
|
||||||
|
<figure>
|
||||||
|
<blockquote>{remembered.text.en}</blockquote>
|
||||||
|
<figcaption>{source(remembered)}</figcaption>
|
||||||
|
</figure>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.petal {
|
||||||
|
display: grid;
|
||||||
|
justify-items: center;
|
||||||
|
gap: var(--space-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 3.5rem;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.words {
|
||||||
|
display: grid;
|
||||||
|
gap: var(--space-3);
|
||||||
|
max-width: 24rem;
|
||||||
|
padding: var(--space-3);
|
||||||
|
border-radius: 1.25rem;
|
||||||
|
background: color-mix(in srgb, var(--rose) 10%, var(--paper));
|
||||||
|
}
|
||||||
|
|
||||||
|
.words:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 0;
|
||||||
|
display: grid;
|
||||||
|
gap: var(--space-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
margin: 0;
|
||||||
|
font-family: var(--font-display);
|
||||||
|
font-size: 1.15rem;
|
||||||
|
line-height: 1.45;
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
figcaption,
|
||||||
|
.remember {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font: inherit;
|
||||||
|
padding: var(--space-2) var(--space-3);
|
||||||
|
border-radius: 999px;
|
||||||
|
border: 1px solid var(--rose);
|
||||||
|
background: var(--paper);
|
||||||
|
color: var(--ink);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quiet {
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
padding: var(--space-1) 0;
|
||||||
|
color: var(--rose);
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:focus-visible {
|
||||||
|
outline: 2px solid var(--rose);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { careEvent, localDay, pour, roseAt, ROSE, type Mood, type RoseNow, type Stage } from '@rosea/engine';
|
import {
|
||||||
import type { CareEvent } from '@rosea/schema';
|
careEvent, goodMoment, localDay, petalAt, pour, roseAt, ROSE, sentenceOpened,
|
||||||
|
type Mood, type PetalNow, type Place, type RoseNow, type Stage
|
||||||
|
} from '@rosea/engine';
|
||||||
|
import type { CareEvent, SentenceOpened } from '@rosea/schema';
|
||||||
import { en } from '../copy/en.js';
|
import { en } from '../copy/en.js';
|
||||||
import KeepSafe from './KeepSafe.svelte';
|
import KeepSafe from './KeepSafe.svelte';
|
||||||
|
import Petal from './Petal.svelte';
|
||||||
import type { RoseWiring } from './types.js';
|
import type { RoseWiring } from './types.js';
|
||||||
// The art board's stand-ins until real art is accepted (rose.md R10, docs/ART.md).
|
// The art board's stand-ins until real art is accepted (rose.md R10, docs/ART.md).
|
||||||
import bud from '../../../../art/placeholders/rose-bud.svg?url';
|
import bud from '../../../../art/placeholders/rose-bud.svg?url';
|
||||||
@@ -19,7 +23,7 @@
|
|||||||
* The rose. Everything she is comes from the engine's replay of her care log
|
* The rose. Everything she is comes from the engine's replay of her care log
|
||||||
* (rose.md); this renders it and turns the player's hands into care events.
|
* (rose.md); this renders it and turns the player's hands into care events.
|
||||||
*/
|
*/
|
||||||
let { wiring, timeZone }: { wiring: RoseWiring; timeZone: string } = $props();
|
let { wiring, timeZone, place = null }: { wiring: RoseWiring; timeZone: string; place?: Place | null } = $props();
|
||||||
|
|
||||||
const STAGE_PICTURE: Record<Stage, string> = { bud, opening, 'half-bloom': halfBloom, 'full-bloom': fullBloom };
|
const STAGE_PICTURE: Record<Stage, string> = { bud, opening, 'half-bloom': halfBloom, 'full-bloom': fullBloom };
|
||||||
const MOOD_PICTURE: Record<Mood, string> = { content: fullBloom, thirsty, 'too-full': overwatered, windblown, blushing, waiting };
|
const MOOD_PICTURE: Record<Mood, string> = { content: fullBloom, thirsty, 'too-full': overwatered, windblown, blushing, waiting };
|
||||||
@@ -29,18 +33,23 @@
|
|||||||
let pastKeys = $state.raw<readonly string[]>([]);
|
let pastKeys = $state.raw<readonly string[]>([]);
|
||||||
let showSafe = $state(false);
|
let showSafe = $state(false);
|
||||||
let events = $state.raw<readonly CareEvent[]>([]);
|
let events = $state.raw<readonly CareEvent[]>([]);
|
||||||
|
/** Her opened petals (day-sentence.md). */
|
||||||
|
let opened = $state.raw<readonly SentenceOpened[]>([]);
|
||||||
let now = $state(0);
|
let now = $state(0);
|
||||||
let kept = $state(true);
|
let kept = $state(true);
|
||||||
let showNumbers = $state(false);
|
let showNumbers = $state(false);
|
||||||
|
/** The petal was opened at the good moment in this visit: she sends the player out to the sky. */
|
||||||
|
let lookUp = $state(false);
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
const w = wiring;
|
const w = wiring;
|
||||||
now = w.now();
|
now = w.now();
|
||||||
Promise.all([w.identity(), w.loadCare(), w.pastKeys()]).then(
|
Promise.all([w.identity(), w.loadCare(), w.pastKeys(), w.loadOpened()]).then(
|
||||||
([id, log, past]) => {
|
([id, log, past, petals]) => {
|
||||||
seed = id.publicKey;
|
seed = id.publicKey;
|
||||||
events = log;
|
events = log;
|
||||||
pastKeys = past;
|
pastKeys = past;
|
||||||
|
opened = petals;
|
||||||
if (!id.kept) kept = false;
|
if (!id.kept) kept = false;
|
||||||
},
|
},
|
||||||
(error: unknown) => {
|
(error: unknown) => {
|
||||||
@@ -54,13 +63,28 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const rose = $derived<RoseNow | null>(seed === null ? null : roseAt(events, [seed, ...pastKeys], now, timeZone));
|
const rose = $derived<RoseNow | null>(seed === null ? null : roseAt(events, [seed, ...pastKeys], now, timeZone));
|
||||||
|
const petal = $derived<PetalNow>(seed === null ? { kind: 'none' } : petalAt(wiring.sentences, opened, [seed, ...pastKeys], now, timeZone));
|
||||||
|
const sunIsLow = $derived(place !== null && now > 0 && goodMoment(now, place));
|
||||||
|
|
||||||
|
function openPetal(): void {
|
||||||
|
if (seed === null || petal.kind !== 'folded') return;
|
||||||
|
now = wiring.now();
|
||||||
|
const event = sentenceOpened({ now, timeZone, from: seed, messageId: petal.id, clientVersion: wiring.clientVersion });
|
||||||
|
lookUp = place !== null && goodMoment(now, place);
|
||||||
|
opened = [...opened, event];
|
||||||
|
wiring.appendOpened(event).catch((error: unknown) => {
|
||||||
|
console.error('rose: the device could not keep the opened petal', error);
|
||||||
|
kept = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** After she is brought back from a file: read her log and keys again. */
|
/** After she is brought back from a file: read her log and keys again. */
|
||||||
function restored(): void {
|
function restored(): void {
|
||||||
Promise.all([wiring.loadCare(), wiring.pastKeys()]).then(
|
Promise.all([wiring.loadCare(), wiring.pastKeys(), wiring.loadOpened()]).then(
|
||||||
([log, past]) => {
|
([log, past, petals]) => {
|
||||||
events = log;
|
events = log;
|
||||||
pastKeys = past;
|
pastKeys = past;
|
||||||
|
opened = petals;
|
||||||
now = wiring.now();
|
now = wiring.now();
|
||||||
},
|
},
|
||||||
(error: unknown) => console.error('rose: could not read her back after restoring', error)
|
(error: unknown) => console.error('rose: could not read her back after restoring', error)
|
||||||
@@ -116,7 +140,10 @@
|
|||||||
: rose.needs.weeds ? s.weeds
|
: rose.needs.weeds ? s.weeds
|
||||||
: rose.needs.petals ? s.petals
|
: rose.needs.petals ? s.petals
|
||||||
: '';
|
: '';
|
||||||
return [rose.drift > 0 ? s.back : '', need].filter(Boolean).join(' ');
|
// The petal only when she needs nothing else: one line at a time (day-sentence.md §1).
|
||||||
|
const p = en.rose.petal;
|
||||||
|
const offer = need !== '' ? '' : petal.kind === 'folded' ? (sunIsLow ? p.goodMoment : p.waiting) : petal.kind === 'open' && lookUp ? p.lookUp : '';
|
||||||
|
return [rose.drift > 0 ? s.back : '', need || offer].filter(Boolean).join(' ');
|
||||||
});
|
});
|
||||||
|
|
||||||
const picture = $derived(rose ? (rose.stage === 'full-bloom' ? MOOD_PICTURE[rose.mood] : STAGE_PICTURE[rose.stage]) : bud);
|
const picture = $derived(rose ? (rose.stage === 'full-bloom' ? MOOD_PICTURE[rose.mood] : STAGE_PICTURE[rose.stage]) : bud);
|
||||||
@@ -175,6 +202,8 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<p class="said" role="status" aria-live="assertive">{pouring && can ? (can.tooFull ? en.rose.plenty : can.leavesLift ? en.rose.leavesLift : '') : ''}</p>
|
<p class="said" role="status" aria-live="assertive">{pouring && can ? (can.tooFull ? en.rose.plenty : can.leavesLift ? en.rose.leavesLift : '') : ''}</p>
|
||||||
|
|
||||||
|
<Petal {petal} sentences={wiring.sentences} onopen={openPetal} />
|
||||||
|
|
||||||
{#if !kept}
|
{#if !kept}
|
||||||
<p class="hint">{en.rose.notKept}</p>
|
<p class="hint">{en.rose.notKept}</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CareEvent } from '@rosea/schema';
|
import type { CareEvent, HopeSentence, SentenceOpened } from '@rosea/schema';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What the rose needs from the app: her care log, her key, and the clock. The app
|
* What the rose needs from the app: her care log, her key, and the clock. The app
|
||||||
@@ -9,6 +9,10 @@ export interface RoseWiring {
|
|||||||
readonly identity: () => Promise<{ readonly publicKey: string; readonly kept: boolean }>;
|
readonly identity: () => Promise<{ readonly publicKey: string; readonly kept: boolean }>;
|
||||||
readonly loadCare: () => Promise<CareEvent[]>;
|
readonly loadCare: () => Promise<CareEvent[]>;
|
||||||
readonly appendCare: (event: CareEvent) => Promise<void>;
|
readonly appendCare: (event: CareEvent) => Promise<void>;
|
||||||
|
/** The verified library, as bundled. Empty: she holds no petal (day-sentence.md). */
|
||||||
|
readonly sentences: readonly HopeSentence[];
|
||||||
|
readonly loadOpened: () => Promise<SentenceOpened[]>;
|
||||||
|
readonly appendOpened: (event: SentenceOpened) => Promise<void>;
|
||||||
readonly clientVersion: string;
|
readonly clientVersion: string;
|
||||||
/** The device's own zone: the rose's day when no sunset town is chosen (rose.md R8). */
|
/** The device's own zone: the rose's day when no sunset town is chosen (rose.md R8). */
|
||||||
readonly deviceZone: string;
|
readonly deviceZone: string;
|
||||||
@@ -18,7 +22,7 @@ export interface RoseWiring {
|
|||||||
readonly pastKeys: () => Promise<string[]>;
|
readonly pastKeys: () => Promise<string[]>;
|
||||||
/** The rose as a file's contents, and bringing one back. */
|
/** The rose as a file's contents, and bringing one back. */
|
||||||
readonly exportRose: (currentKey: string) => Promise<unknown>;
|
readonly exportRose: (currentKey: string) => Promise<unknown>;
|
||||||
readonly importRose: (file: unknown, currentKey: string) => Promise<{ readonly added: number }>;
|
readonly importRose: (file: unknown, currentKey: string) => Promise<{ readonly added: number; readonly petals: number }>;
|
||||||
/** Hands the player a file to keep. */
|
/** Hands the player a file to keep. */
|
||||||
readonly saveFile: (name: string, text: string) => void;
|
readonly saveFile: (name: string, text: string) => void;
|
||||||
/** The browser's promise to keep the garden: true, false, or null when it cannot say. */
|
/** The browser's promise to keep the garden: true, false, or null when it cannot say. */
|
||||||
|
|||||||
@@ -0,0 +1,168 @@
|
|||||||
|
import { addDays, careEvent, invitation, petalOrder, roseAt, sentenceOpened, sunDay, type Place } from '@rosea/engine';
|
||||||
|
import type { CareEvent, HopeSentence, SentenceOpened } from '@rosea/schema';
|
||||||
|
import { cleanup, fireEvent, render, screen, within } from '@testing-library/svelte';
|
||||||
|
import { tick } from 'svelte';
|
||||||
|
import { afterEach, describe, expect, it } from 'vitest';
|
||||||
|
import { en } from '../src/copy/en.js';
|
||||||
|
import Rose from '../src/rose/Rose.svelte';
|
||||||
|
import type { RoseWiring } from '../src/rose/types.js';
|
||||||
|
|
||||||
|
const ZONE = 'Europe/Prague';
|
||||||
|
const ME = 'M'.repeat(87);
|
||||||
|
const HOUR = 3_600_000;
|
||||||
|
const DAY = 24 * HOUR;
|
||||||
|
const prague: Place = { lat: 50.0755, lon: 14.4378, timeZone: ZONE };
|
||||||
|
|
||||||
|
const line = (id: string, text: string, over: Partial<HopeSentence['source']> = {}): HopeSentence => ({
|
||||||
|
id,
|
||||||
|
text: { en: text },
|
||||||
|
source: { work: `Fixture ${id}`, author: null, tradition: 'fixture', translation: null, publicDomain: true, verifiedBy: 'Test', verifiedAt: '2026-11-01', ...over },
|
||||||
|
use: ['sunset'],
|
||||||
|
tone: 'gentle',
|
||||||
|
promisesOutcome: false
|
||||||
|
});
|
||||||
|
const LIBRARY: HopeSentence[] = [
|
||||||
|
line('fx-one', 'The first fixture line.', { author: 'A Writer', translation: 'A Translator, 1900' }),
|
||||||
|
line('fx-two', 'The second fixture line.'),
|
||||||
|
line('fx-three', 'The third fixture line.')
|
||||||
|
];
|
||||||
|
const order = petalOrder(LIBRARY);
|
||||||
|
const textOf = (id: string): string => LIBRARY.find((s) => s.id === id)!.text.en;
|
||||||
|
|
||||||
|
const water = (now: number): CareEvent => careEvent({ now, timeZone: ZONE, from: ME, to: ME, act: 'water', amount: 0.5, clientVersion: '0.1.0' });
|
||||||
|
const opening = (now: number, messageId: string): SentenceOpened => sentenceOpened({ now, timeZone: ZONE, from: ME, messageId, clientVersion: '0.1.0' });
|
||||||
|
|
||||||
|
const quiet = (log: CareEvent[], now: number): boolean => {
|
||||||
|
const r = roseAt(log, ME, now, ZONE);
|
||||||
|
return !r.needs.water && !r.needs.wind && !r.needs.weeds && !r.needs.petals && r.mood === 'content';
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A daytime moment, an hour or more after a helpful 08:00 pour on the same local day,
|
||||||
|
* at which she needs nothing and is not blushing: then the petal is hers to offer.
|
||||||
|
* Found with the engine, so the test does not guess the day's weeds and wind.
|
||||||
|
*/
|
||||||
|
function quietMoment(from: number): { log: CareEvent[]; now: number } {
|
||||||
|
for (let day = 0; day < 30; day++) {
|
||||||
|
const pour = from + day * DAY;
|
||||||
|
const log = [water(pour)];
|
||||||
|
for (let later = pour + HOUR; later <= pour + 10 * HOUR; later += 10 * 60_000) {
|
||||||
|
if (quiet(log, later)) return { log, now: later };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error('no quiet moment in 30 days');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A day's sunset at which she needs nothing, after a pour that afternoon. */
|
||||||
|
function quietSunset(): { log: CareEvent[]; now: number } {
|
||||||
|
for (let day = 0; day < 60; day++) {
|
||||||
|
const sunset = invitation(sunDay(addDays('2026-03-02', day), prague));
|
||||||
|
for (let hours = 2; hours <= 6; hours++) {
|
||||||
|
const log = [water(sunset - hours * HOUR)];
|
||||||
|
if (quiet(log, sunset)) return { log, now: sunset };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error('no quiet sunset in 60 days');
|
||||||
|
}
|
||||||
|
|
||||||
|
function wiring(p: { log?: CareEvent[]; opened?: SentenceOpened[]; at: number; sentences?: HopeSentence[] }): RoseWiring & { appendedOpened: SentenceOpened[] } {
|
||||||
|
const appendedOpened: SentenceOpened[] = [];
|
||||||
|
return {
|
||||||
|
identity: async () => ({ publicKey: ME, kept: true }),
|
||||||
|
loadCare: async () => p.log ?? [],
|
||||||
|
appendCare: async () => undefined,
|
||||||
|
sentences: p.sentences ?? LIBRARY,
|
||||||
|
loadOpened: async () => p.opened ?? [],
|
||||||
|
appendOpened: async (e) => {
|
||||||
|
appendedOpened.push(e);
|
||||||
|
},
|
||||||
|
clientVersion: '0.1.0',
|
||||||
|
deviceZone: ZONE,
|
||||||
|
now: () => p.at,
|
||||||
|
pastKeys: async () => [],
|
||||||
|
exportRose: async () => ({}),
|
||||||
|
importRose: async () => ({ added: 0, petals: 0 }),
|
||||||
|
saveFile: () => undefined,
|
||||||
|
keeping: { persisted: async () => false, persist: async () => true },
|
||||||
|
installHint: false,
|
||||||
|
appendedOpened
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const MORNING = Date.parse('2026-03-02T08:00:00+01:00');
|
||||||
|
const bubble = (): string => document.querySelector('.bubble')?.textContent ?? '';
|
||||||
|
|
||||||
|
afterEach(() => cleanup());
|
||||||
|
|
||||||
|
describe('the folded petal (day-sentence.md)', () => {
|
||||||
|
it('with an empty library: no petal, and she says nothing about one', async () => {
|
||||||
|
const q = quietMoment(MORNING);
|
||||||
|
render(Rose, { wiring: wiring({ log: q.log, at: q.now, sentences: [] }), timeZone: ZONE });
|
||||||
|
await screen.findByRole('button', { name: en.rose.water });
|
||||||
|
expect(screen.queryByRole('button', { name: en.rose.petal.open })).toBeNull();
|
||||||
|
expect(bubble()).not.toContain('petal');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('when she needs nothing, she says she keeps it, and offers it', async () => {
|
||||||
|
const q = quietMoment(MORNING);
|
||||||
|
render(Rose, { wiring: wiring({ log: q.log, at: q.now }), timeZone: ZONE, place: prague });
|
||||||
|
expect(await screen.findByRole('button', { name: en.rose.petal.open })).toBeTruthy();
|
||||||
|
expect(screen.getByRole('img', { name: en.rose.petal.folded })).toBeTruthy();
|
||||||
|
expect(bubble()).toBe(en.rose.petal.waiting);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('when she needs something, the need is what she says, and the petal still waits', async () => {
|
||||||
|
render(Rose, { wiring: wiring({ at: MORNING }), timeZone: ZONE });
|
||||||
|
expect(await screen.findByRole('button', { name: en.rose.petal.open })).toBeTruthy();
|
||||||
|
// A new rose's soil is dry.
|
||||||
|
expect(bubble()).toBe(en.rose.says.dry);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('opening it keeps one event, shows the words and where they come from, and moves focus to them', async () => {
|
||||||
|
const q = quietMoment(MORNING);
|
||||||
|
const w = wiring({ log: q.log, at: q.now });
|
||||||
|
render(Rose, { wiring: w, timeZone: ZONE, place: prague });
|
||||||
|
await fireEvent.click(await screen.findByRole('button', { name: en.rose.petal.open }));
|
||||||
|
await tick();
|
||||||
|
expect(w.appendedOpened).toEqual([opening(q.now, order[0]!)]);
|
||||||
|
expect(screen.queryByRole('button', { name: en.rose.petal.open })).toBeNull();
|
||||||
|
const words = document.getElementById(screen.getByRole('button', { name: en.rose.petal.today }).getAttribute('aria-controls')!)!;
|
||||||
|
expect(within(words).getByText(textOf(order[0]!))).toBeTruthy();
|
||||||
|
const s = LIBRARY.find((x) => x.id === order[0])!.source;
|
||||||
|
expect(within(words).getByText(en.rose.petal.source(s.work, s.author, s.translation))).toBeTruthy();
|
||||||
|
expect(document.activeElement).toBe(words);
|
||||||
|
// Away from sunset, opening it changes nothing in what she says.
|
||||||
|
expect(bubble()).toBe('');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('opened earlier today: the same words come back, and can be folded away and back', async () => {
|
||||||
|
const q = quietMoment(MORNING);
|
||||||
|
render(Rose, { wiring: wiring({ log: q.log, at: q.now, opened: [opening(q.now - 60_000, 'fx-two')] }), timeZone: ZONE });
|
||||||
|
const today = await screen.findByRole('button', { name: en.rose.petal.today });
|
||||||
|
expect(today.getAttribute('aria-expanded')).toBe('true');
|
||||||
|
expect(screen.getByText(textOf('fx-two'))).toBeTruthy();
|
||||||
|
expect(screen.queryByRole('button', { name: en.rose.petal.open })).toBeNull();
|
||||||
|
await fireEvent.click(today);
|
||||||
|
expect(today.getAttribute('aria-expanded')).toBe('false');
|
||||||
|
expect(screen.queryByText(textOf('fx-two'))).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('on a nearby day she also remembers an earlier one', async () => {
|
||||||
|
const q = quietMoment(MORNING);
|
||||||
|
const opened = [opening(q.now - DAY, order[0]!), opening(q.now - 60_000, order[1]!)];
|
||||||
|
render(Rose, { wiring: wiring({ log: q.log, at: q.now, opened }), timeZone: ZONE });
|
||||||
|
expect(await screen.findByText(en.rose.petal.remember)).toBeTruthy();
|
||||||
|
expect(screen.getByText(textOf(order[0]!))).toBeTruthy();
|
||||||
|
expect(screen.getByText(textOf(order[1]!))).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('at sunset she says the sun is low, and once it is opened, sends the player to the sky', async () => {
|
||||||
|
const q = quietSunset();
|
||||||
|
render(Rose, { wiring: wiring({ log: q.log, at: q.now }), timeZone: ZONE, place: prague });
|
||||||
|
await screen.findByRole('button', { name: en.rose.petal.open });
|
||||||
|
expect(bubble()).toBe(en.rose.petal.goodMoment);
|
||||||
|
await fireEvent.click(screen.getByRole('button', { name: en.rose.petal.open }));
|
||||||
|
await tick();
|
||||||
|
expect(bubble()).toBe(en.rose.petal.lookUp);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -28,7 +28,10 @@ function wiring(over: Partial<RoseWiring> & { log?: CareEvent[]; at?: number } =
|
|||||||
now: () => at,
|
now: () => at,
|
||||||
pastKeys: async () => [],
|
pastKeys: async () => [],
|
||||||
exportRose: async (key) => ({ format: 'rosea-rose', version: 1, keys: [key], events: [...(over.log ?? []), ...appended] }),
|
exportRose: async (key) => ({ format: 'rosea-rose', version: 1, keys: [key], events: [...(over.log ?? []), ...appended] }),
|
||||||
importRose: async () => ({ added: 0 }),
|
importRose: async () => ({ added: 0, petals: 0 }),
|
||||||
|
sentences: [],
|
||||||
|
loadOpened: async () => [],
|
||||||
|
appendOpened: async () => undefined,
|
||||||
saveFile: (name, text) => {
|
saveFile: (name, text) => {
|
||||||
saved.push({ name, text });
|
saved.push({ name, text });
|
||||||
},
|
},
|
||||||
@@ -203,7 +206,7 @@ describe('keep her safe (keep-her-safe.md)', () => {
|
|||||||
importRose: async (file) => {
|
importRose: async (file) => {
|
||||||
expect(file).toMatchObject({ keys: [OLD] });
|
expect(file).toMatchObject({ keys: [OLD] });
|
||||||
restored = true;
|
restored = true;
|
||||||
return { added: 1 };
|
return { added: 1, petals: 0 };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
render(Rose, { wiring: w, timeZone: ZONE });
|
render(Rose, { wiring: w, timeZone: ZONE });
|
||||||
|
|||||||
Reference in New Issue
Block a user