19 lines
649 B
TypeScript
19 lines
649 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
|
|
test("settings page refreshes when user settings change", async () => {
|
|
const source = await readFile(
|
|
new URL("../src/app/me/settings/page.tsx", import.meta.url),
|
|
"utf8",
|
|
);
|
|
|
|
assert.match(source, /import \{ RealtimeRefresh \}/, "expected settings page to import RealtimeRefresh");
|
|
assert.match(source, /<RealtimeRefresh/, "expected settings page to render RealtimeRefresh");
|
|
assert.match(
|
|
source,
|
|
/events=\{\["settings\.updated"\]\}/,
|
|
"expected settings page to refresh on settings.updated",
|
|
);
|
|
});
|