diff --git a/browser_tests/tests/confirmDialogTextWrap.spec.ts b/browser_tests/tests/confirmDialogTextWrap.spec.ts new file mode 100644 index 00000000000..6a12ccd1b66 --- /dev/null +++ b/browser_tests/tests/confirmDialogTextWrap.spec.ts @@ -0,0 +1,32 @@ +import { expect } from '@playwright/test' + +import { comfyPageFixture as test } from '../fixtures/ComfyPage' + +test.describe('Confirm dialog text wrapping', { tag: ['@mobile'] }, () => { + test('@mobile confirm dialog buttons are visible with long unbreakable text', async ({ + comfyPage + }) => { + const longFilename = 'workflow_checkpoint_' + 'a'.repeat(200) + '.json' + + await comfyPage.page.evaluate((msg) => { + window + .app!.extensionManager.dialog.confirm({ + title: 'Confirm', + type: 'default', + message: msg + }) + .catch(() => {}) + }, longFilename) + + const dialog = comfyPage.page.getByRole('dialog') + await expect(dialog).toBeVisible() + + const confirmButton = dialog.getByRole('button', { name: 'Confirm' }) + await expect(confirmButton).toBeVisible() + await expect(confirmButton).toBeInViewport() + + const cancelButton = dialog.getByRole('button', { name: 'Cancel' }) + await expect(cancelButton).toBeVisible() + await expect(cancelButton).toBeInViewport() + }) +}) diff --git a/src/components/dialog/GlobalDialog.vue b/src/components/dialog/GlobalDialog.vue index aede769071d..9f2c4e41e08 100644 --- a/src/components/dialog/GlobalDialog.vue +++ b/src/components/dialog/GlobalDialog.vue @@ -78,6 +78,10 @@ function getDialogPt(item: {