Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Button test in Jest #749

Closed
wants to merge 13 commits into from
16 changes: 12 additions & 4 deletions test/ui-testing/publishButton.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ beforeAll(async () => {
await page.goto('file://' + path, {waitUntil: 'domcontentloaded'});
});

global.window = window
global.$ = require('jquery');

describe('Publish button', () => {

test('something we are testing described here', () => {
test('publish button gets enabled', () => {
// Check initially that Publish button is disabled.
expect($('.ple-publish').prop('disabled')).toBe(true);
// Add title.
$('.ple-module-title input').val('Title');
$('.ple-module-title input').keydown();
// Check final state of Publish button.
expect($('.ple-publish').prop('disabled')).toBe(false);
}, timeout);

});

});