Skip to content

Commit c8ced44

Browse files
authored
Merge pull request #58 from quanru/fix/plugin-smoke-report-contract
test: lock in reportable Omarchy plugin smoke assertion
2 parents 818cddb + 37e3c5f commit c8ced44

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

‎tests/contracts/test_pages_report_history.mjs‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import assert from 'node:assert/strict';
2+
import { execFileSync } from 'node:child_process';
23
import { mkdir, mkdtemp, readFile, writeFile } from 'node:fs/promises';
34
import http from 'node:http';
45
import os from 'node:os';
@@ -99,6 +100,43 @@ test('records every shard and renders the Summary before Pages deployment', asyn
99100
);
100101
});
101102

103+
test('plugin smoke keeps its visual assertion as a reportable Midscene step', async () => {
104+
const source = await readFile(
105+
new URL('../e2e/cases/omarchy-plugin-smoke.yaml', import.meta.url),
106+
'utf8',
107+
);
108+
const renderer = await readFile(
109+
new URL('../e2e/render-omarchy-plugin-smoke.mjs', import.meta.url),
110+
'utf8',
111+
);
112+
const runner = await readFile(
113+
new URL('../e2e/run-omarchy-midscene.sh', import.meta.url),
114+
'utf8',
115+
);
116+
assert.match(source, /- review\.openConfigured: \{\}[\s\S]*- aiAssert: __REVIEW_VISIBLE_ASSERTION__/);
117+
assert.doesNotMatch(source, /review\.assertConfiguredVisual/);
118+
assert.match(
119+
runner,
120+
/omarchy-plugin-smoke\)\s+node tests\/e2e\/render-omarchy-plugin-smoke\.mjs\s+npm --prefix tests\/e2e test/,
121+
);
122+
123+
const root = await mkdtemp(path.join(os.tmpdir(), 'plugin-smoke-render-'));
124+
await mkdir(path.join(root, 'cases'));
125+
await writeFile(path.join(root, 'render-omarchy-plugin-smoke.mjs'), renderer);
126+
await writeFile(path.join(root, 'cases/omarchy-plugin-smoke.yaml'), source);
127+
const assertion = 'The Todos popup says "ready": #1\nNo text was delivered.';
128+
execFileSync(process.execPath, [path.join(root, 'render-omarchy-plugin-smoke.mjs')], {
129+
env: { ...process.env, REVIEW_VISIBLE_ASSERTION: assertion },
130+
});
131+
const rendered = await readFile(
132+
path.join(root, 'cases/omarchy-plugin-smoke.yaml'),
133+
'utf8',
134+
);
135+
assert.match(rendered, /- review\.openConfigured: \{\}/);
136+
assert.ok(rendered.includes(`- aiAssert: ${JSON.stringify(assertion)}`));
137+
assert.doesNotMatch(rendered, /__REVIEW_VISIBLE_ASSERTION__/);
138+
});
139+
102140
test('rerun aggregation excludes the previous combined report artifact', async () => {
103141
const source = await readFile(
104142
new URL('../../.github/workflows/midscene-omarchy-4.0.3.yml', import.meta.url),

0 commit comments

Comments
 (0)