diff --git a/tests/smoke/_harness/pluginMocks.mjs b/tests/smoke/_harness/pluginMocks.mjs index 2ead59b..77c1138 100644 --- a/tests/smoke/_harness/pluginMocks.mjs +++ b/tests/smoke/_harness/pluginMocks.mjs @@ -1,6 +1,7 @@ import { readFile } from "node:fs/promises"; import { resolve } from "node:path"; import { pathToFileURL } from "node:url"; +import { pluginRepo } from "./index.mjs"; /** An installed package of the old Table Formulas plugin. RuneStone now includes the feature and must not load this code. */ export const oldTableFormulasRow = { @@ -13,7 +14,8 @@ export const oldTableFormulasRow = { * `extraRows` adds installed rows without code, for example `oldTableFormulasRow`. */ export async function mockFeaturePlugins(surface, extraRows = []) { - const root = process.env.RUNESTONE_TERMINAL_DIST ? pathToFileURL(resolve(process.env.RUNESTONE_TERMINAL_DIST) + "/") : new URL("../../../../RuneStone_Terminal/dist/", import.meta.url); + // The runner checks the same folder for "@requires plugin:terminal". + const root = pathToFileURL(resolve(process.env.RUNESTONE_TERMINAL_DIST || pluginRepo("RuneStone_Terminal/dist")) + "/"); const packages = [{ manifest: JSON.parse(await readFile(new URL("plugin.json", root), "utf8")), code: await readFile(new URL("main.js", root), "utf8"), diff --git a/tests/smoke/tables/formulas.smoke.mjs b/tests/smoke/tables/formulas.smoke.mjs index 68ed850..65d1d17 100644 --- a/tests/smoke/tables/formulas.smoke.mjs +++ b/tests/smoke/tables/formulas.smoke.mjs @@ -100,6 +100,8 @@ await runSmoke("tables/formulas", async ({ page }) => { await edit.fill('=D3'); // Enter would start editing D4 below (src/lib/editor/tableControls.ts:283), so leave the table to render both results. await page.keyboard.press('Control+Enter'); + // The table renders again after it loses focus. Wait for that before the check. + for (const [r, c] of [[2, 3], [3, 3]]) await result(r, c).filter({ hasText: /^#CYCLE!$/ }).waitFor(); assert.equal(await result(2, 3).innerText(), '#CYCLE!'); assert.equal(await result(3, 3).innerText(), '#CYCLE!'); await cell(2, 3).click();