DEV: remove qunit rails fork and add a couple of async tests

This commit is contained in:
Sam
2018-04-23 16:42:25 +10:00
parent 0a442977b3
commit 54d153068a
9 changed files with 489 additions and 22 deletions

View File

@@ -7,21 +7,20 @@ acceptance('Composer Actions', {
}
});
QUnit.test('replying to post', assert => {
QUnit.test('replying to post', async assert => {
const composerActions = selectKit('.composer-actions');
visit('/t/internationalization-localization/280');
click('article#post_3 button.reply');
composerActions.expand();
await composerActions.expandAwait();
assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic');
assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message');
assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic');
assert.equal(composerActions.rowByIndex(3).value(), 'toggle_whisper');
assert.equal(composerActions.rowByIndex(4).value(), undefined);
andThen(() => {
assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic');
assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message');
assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic');
assert.equal(composerActions.rowByIndex(3).value(), 'toggle_whisper');
assert.equal(composerActions.rowByIndex(4).value(), undefined);
});
});
QUnit.test('replying to post - reply_as_private_message', assert => {

View File

@@ -1,17 +1,13 @@
import { acceptance } from "helpers/qunit-helpers";
acceptance("User Directory");
QUnit.test("Visit Page", assert => {
visit("/users");
andThen(() => {
assert.ok($('body.users-page').length, "has the body class");
assert.ok(exists('.directory table tr'), "has a list of users");
});
QUnit.test("Visit Page", async assert => {
await visit("/users");
assert.ok($('body.users-page').length, "has the body class");
assert.ok(exists('.directory table tr'), "has a list of users");
});
QUnit.test("Visit All Time", assert => {
visit("/users?period=all");
andThen(() => {
assert.ok(exists('.time-read'), "has time read column");
});
});
QUnit.test("Visit All Time", async assert => {
await visit("/users?period=all");
assert.ok(exists('.time-read'), "has time read column");
});

View File

@@ -105,6 +105,10 @@ function selectKit(selector) { // eslint-disable-line no-unused-vars
};
return {
expandAwait: function() {
return expandSelectKit(selector);
},
expand: function() {
expandSelectKit(selector);
return selectKit(selector);