diff --git a/test/ui-testing/publishButton.test.js b/test/ui-testing/publishButton.test.js index e52f7b7d..99106e46 100644 --- a/test/ui-testing/publishButton.test.js +++ b/test/ui-testing/publishButton.test.js @@ -7,8 +7,16 @@ beforeAll(async () => { describe('Publish button', () => { - test('something we are testing described here', () => { - + test('Publish button is enabled', async () => { + // Check initially that Publish button is disabled. + expect(await page.evaluate(() => document.querySelector('.ple-publish').disabled)).toBe(true); + // Add title. + await page.evaluate(() => { + document.querySelector('.ple-module-title input').value = 'A title'; + document.querySelector('.ple-module-title input').dispatchEvent(new KeyboardEvent('keydown', { "code": "9" })); // random key + }); + // Check final state of Publish button. + expect(await page.evaluate(() => document.querySelector('.ple-publish').disabled)).toBe(false); }); - + });