app: Generate All says so when every scene is excluded
Found by the adversarial pass on the exclude commit: every other early-return in generateAll() says something (empty load, cancelled, N failed) except this one -- excluding every scene made the button do nothing with no feedback, indistinguishable from a hang.
This commit is contained in:
+1
-1
@@ -151,7 +151,7 @@ async function start() {
|
||||
// 5" while two of the five were never going to run reads as a wrong
|
||||
// number, not as a batch that respected the exclude.
|
||||
const scenes = project.scenes.filter((s) => !s.excluded);
|
||||
if (!scenes.length) return;
|
||||
if (!scenes.length) { page.transport.say("Every scene is excluded -- nothing to generate."); return; }
|
||||
generateAllBtn.setDisabled(true);
|
||||
batchCancelled = false;
|
||||
page.transport.hold(`Generating scene 1 of ${scenes.length}…`);
|
||||
|
||||
@@ -87,6 +87,24 @@ test("an excluded scene is skipped, and does not count toward the total", async
|
||||
.toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test("excluding every scene says so instead of doing nothing silently", async ({ page }) => {
|
||||
await app(page);
|
||||
await page.evaluate(() => {
|
||||
const { project } = window.FunPack;
|
||||
while (project.scenes.length < 2) project.addScene();
|
||||
for (const s of project.scenes) project.setScene(s.id, "excluded", true);
|
||||
});
|
||||
|
||||
const btn = page.getByRole("button", { name: "Generate All" });
|
||||
await btn.click();
|
||||
|
||||
await expect(page.locator(".cx-panel-status", { hasText: /every scene is excluded/i }))
|
||||
.toBeVisible();
|
||||
// Nothing was ever started -- the button was never disabled by a batch
|
||||
// that had nothing to run.
|
||||
await expect(btn).toBeEnabled();
|
||||
});
|
||||
|
||||
test("a second click while a batch is already running does not start an overlapping one", async ({ page }) => {
|
||||
await app(page);
|
||||
await page.evaluate(() => {
|
||||
|
||||
Reference in New Issue
Block a user