From 8eac8a0ee84b5419a4e1061a653699238bf296fe Mon Sep 17 00:00:00 2001 From: Pavel Kvach Date: Sun, 31 Mar 2024 09:47:00 +0300 Subject: [PATCH] js: isso.js: Disable Postbox submit button on click, enable after response Disable the submit button in Postbox to prevent double posting upon click. Enable the button after receiving a response from the API endpoint. Fixes https://github.com/posativ/isso/issues/913 --- isso/js/tests/screenshots/screenshots.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/isso/js/tests/screenshots/screenshots.test.js b/isso/js/tests/screenshots/screenshots.test.js index 4757db92..45393590 100644 --- a/isso/js/tests/screenshots/screenshots.test.js +++ b/isso/js/tests/screenshots/screenshots.test.js @@ -73,11 +73,13 @@ test('Screenshot with inserted comment', async () => { expect(page).toClick('.isso-post-action > input[type=submit]'), ]); + await page.waitForSelector('#isso-1'); const rendered_comment = await page.$('#isso-1'); await rendered_comment.screenshot({ path: SCREENSHOTS_PATH + '/comment.png' }); + await page.waitForSelector('#isso-thread'); const thread = await page.$('#isso-thread'); await thread.screenshot({ path: SCREENSHOTS_PATH + '/thread.png'