fix: match actual i18n button text "Create a link" / "Update link"

The tests used /create link/i which did not match the actual
English i18n text "Create a link" (with "a"). Fixed all assertions
to match the real button labels and removed debug logging.
This commit is contained in:
bymyself
2026-03-30 18:39:27 -07:00
parent 1139f160f0
commit fe4d77d024

View File

@@ -249,46 +249,14 @@ test.describe('Share Workflow Dialog', { tag: '@cloud' }, () => {
await saveAndWait(comfyPage, workflowName)
// Debug: capture workflow state before opening dialog
const preDialogState = await page.evaluate(() => {
const store = (window.app!.extensionManager as WorkspaceStore).workflow
const wf = store.activeWorkflow
return {
hasWorkflow: !!wf,
path: wf?.path,
isTemporary: wf?.isTemporary,
isModified: wf?.isModified,
size: wf?.size,
hasChangeTracker: !!wf?.changeTracker
}
})
console.log('Pre-dialog workflow state:', JSON.stringify(preDialogState))
await mockPublishStatus(page, null)
await mockShareableAssets(page)
// Log all route-matched requests to debug interception
page.on('requestfinished', async (req) => {
const url = req.url()
if (url.includes('userdata') || url.includes('publish')) {
const resp = await req.response()
console.log(`[REQ] ${req.method()} ${url} -> ${resp?.status()}`)
}
})
await openShareDialog(page)
const dialog = getShareDialog(page)
await expect(dialog).toBeVisible()
// Debug: capture what buttons are in the dialog
const dialogButtons = await dialog
.getByRole('button')
.allTextContents()
console.log('Dialog buttons:', JSON.stringify(dialogButtons))
await expect(
dialog.getByRole('button', { name: /create link/i })
dialog.getByRole('button', { name: /create a link/i })
).toBeVisible()
})
@@ -331,7 +299,7 @@ test.describe('Share Workflow Dialog', { tag: '@cloud' }, () => {
const dialog = getShareDialog(page)
await expect(dialog).toBeVisible()
await expect(
dialog.getByRole('button', { name: /update link/i })
dialog.getByRole('button', { name: /update\s+link/i })
).toBeVisible()
})
@@ -365,7 +333,7 @@ test.describe('Share Workflow Dialog', { tag: '@cloud' }, () => {
await openShareDialog(page)
const dialog = getShareDialog(page)
const createButton = dialog.getByRole('button', { name: /create link/i })
const createButton = dialog.getByRole('button', { name: /create a link/i })
await expect(createButton).toBeVisible()
await createButton.click()
@@ -439,7 +407,7 @@ test.describe('Share Workflow Dialog', { tag: '@cloud' }, () => {
await openShareDialog(page)
const dialog = getShareDialog(page)
const createButton = dialog.getByRole('button', { name: /create link/i })
const createButton = dialog.getByRole('button', { name: /create a link/i })
await expect(createButton).toBeDisabled()
await dialog.locator('input[type="checkbox"]').check()