mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-26 10:06:13 +00:00
refactors acceptance login into helper function. adds acceptance tests for tabbed dataset routes
This commit is contained in:
parent
ca7ef2136d
commit
c90ff310f7
@ -0,0 +1,23 @@
|
||||
import { test } from 'qunit';
|
||||
import moduleForAcceptance from 'wherehows-web/tests/helpers/module-for-acceptance';
|
||||
import { visit, find, currentURL, waitUntil } from 'ember-native-dom-helpers';
|
||||
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||
import appLogin from 'wherehows-web/tests/helpers/login/test-login';
|
||||
|
||||
moduleForAcceptance('Acceptance | datasets/dataset/comments', {
|
||||
async beforeEach() {
|
||||
appLogin();
|
||||
}
|
||||
});
|
||||
|
||||
test('visiting /datasets/dataset/comments', async function(assert) {
|
||||
assert.expect(2);
|
||||
defaultScenario(server);
|
||||
const url = '/datasets/12345/comments';
|
||||
|
||||
await visit(url);
|
||||
assert.equal(currentURL(), url, 'comments route is visitable');
|
||||
|
||||
await waitUntil(() => find('.ivy-tabs-tab'));
|
||||
assert.equal(find('.ivy-tabs-tab.active').textContent.trim(), 'Comments', 'comments tab is selected');
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
import { test } from 'qunit';
|
||||
import moduleForAcceptance from 'wherehows-web/tests/helpers/module-for-acceptance';
|
||||
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||
import { visit, find, currentURL, waitUntil } from 'ember-native-dom-helpers';
|
||||
import appLogin from 'wherehows-web/tests/helpers/login/test-login';
|
||||
|
||||
moduleForAcceptance('Acceptance | datasets/dataset/ownership', {
|
||||
async beforeEach() {
|
||||
appLogin();
|
||||
}
|
||||
});
|
||||
|
||||
test('visiting /datasets/dataset/ownership', async function(assert) {
|
||||
assert.expect(2);
|
||||
defaultScenario(server);
|
||||
const url = '/datasets/12345/ownership';
|
||||
|
||||
await visit(url);
|
||||
assert.equal(currentURL(), url, 'ownership route is visitable');
|
||||
|
||||
await waitUntil(() => find('.ivy-tabs-tab'));
|
||||
assert.equal(find('.ivy-tabs-tab.active').textContent.trim(), 'Ownership', 'ownership tab is selected');
|
||||
});
|
@ -1,20 +1,12 @@
|
||||
import { test } from 'qunit';
|
||||
import moduleForAcceptance from 'wherehows-web/tests/helpers/module-for-acceptance';
|
||||
import { visit, click, find, fillIn, currentURL, waitUntil } from 'ember-native-dom-helpers';
|
||||
import { authenticationUrl, testUser, testPassword } from 'wherehows-web/tests/helpers/login/constants';
|
||||
import {
|
||||
loginUserInput,
|
||||
loginPasswordInput,
|
||||
loginSubmitButton
|
||||
} from 'wherehows-web/tests/helpers/login/page-element-constants';
|
||||
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||
import { visit, find, currentURL, waitUntil } from 'ember-native-dom-helpers';
|
||||
import appLogin from 'wherehows-web/tests/helpers/login/test-login';
|
||||
|
||||
moduleForAcceptance('Acceptance | datasets/dataset/properties', {
|
||||
async beforeEach() {
|
||||
await visit(authenticationUrl);
|
||||
await fillIn(loginUserInput, testUser);
|
||||
await fillIn(loginPasswordInput, testPassword);
|
||||
await click(loginSubmitButton);
|
||||
appLogin();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
import { test } from 'qunit';
|
||||
import moduleForAcceptance from 'wherehows-web/tests/helpers/module-for-acceptance';
|
||||
import { visit, find, currentURL, waitUntil } from 'ember-native-dom-helpers';
|
||||
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||
import appLogin from 'wherehows-web/tests/helpers/login/test-login';
|
||||
|
||||
moduleForAcceptance('Acceptance | datasets/dataset/relations', {
|
||||
async beforeEach() {
|
||||
appLogin();
|
||||
}
|
||||
});
|
||||
|
||||
test('visiting /datasets/dataset/relations', async function(assert) {
|
||||
assert.expect(2);
|
||||
defaultScenario(server);
|
||||
const url = '/datasets/12345/relations';
|
||||
|
||||
await visit(url);
|
||||
assert.equal(currentURL(), url, 'relations route is visitable');
|
||||
|
||||
await waitUntil(() => find('.ivy-tabs-tab'));
|
||||
assert.equal(find('.ivy-tabs-tab.active').textContent.trim(), 'Relations', 'relations tab is selected');
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
import { test } from 'qunit';
|
||||
import moduleForAcceptance from 'wherehows-web/tests/helpers/module-for-acceptance';
|
||||
import { visit, find, currentURL, waitUntil } from 'ember-native-dom-helpers';
|
||||
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||
import appLogin from 'wherehows-web/tests/helpers/login/test-login';
|
||||
|
||||
moduleForAcceptance('Acceptance | datasets/dataset/sample', {
|
||||
async beforeEach() {
|
||||
appLogin();
|
||||
}
|
||||
});
|
||||
|
||||
test('visiting /datasets/dataset/sample', async function(assert) {
|
||||
assert.expect(2);
|
||||
defaultScenario(server);
|
||||
const url = '/datasets/12345/sample';
|
||||
|
||||
await visit(url);
|
||||
assert.equal(currentURL(), url, 'sample route is visitable');
|
||||
|
||||
await waitUntil(() => find('.ivy-tabs-tab'));
|
||||
assert.equal(find('.ivy-tabs-tab.active').textContent.trim(), 'Sample Data', 'sample tab is selected');
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
import { test } from 'qunit';
|
||||
import moduleForAcceptance from 'wherehows-web/tests/helpers/module-for-acceptance';
|
||||
import { visit, find, currentURL, waitUntil } from 'ember-native-dom-helpers';
|
||||
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||
import appLogin from 'wherehows-web/tests/helpers/login/test-login';
|
||||
|
||||
moduleForAcceptance('Acceptance | datasets/dataset/schema', {
|
||||
async beforeEach() {
|
||||
appLogin();
|
||||
}
|
||||
});
|
||||
|
||||
test('visiting /datasets/dataset/schema', async function(assert) {
|
||||
assert.expect(2);
|
||||
defaultScenario(server);
|
||||
const url = '/datasets/12345/schema';
|
||||
|
||||
await visit(url);
|
||||
assert.equal(currentURL(), url, 'schema route is visitable');
|
||||
|
||||
await waitUntil(() => find('.ivy-tabs-tab'));
|
||||
assert.equal(find('.ivy-tabs-tab.active').textContent.trim(), 'Schema', 'schema tab is selected');
|
||||
});
|
16
wherehows-web/tests/helpers/login/test-login.js
Normal file
16
wherehows-web/tests/helpers/login/test-login.js
Normal file
@ -0,0 +1,16 @@
|
||||
import { visit, click, fillIn } from 'ember-native-dom-helpers';
|
||||
import { authenticationUrl, testUser, testPassword } from 'wherehows-web/tests/helpers/login/constants';
|
||||
import {
|
||||
loginUserInput,
|
||||
loginPasswordInput,
|
||||
loginSubmitButton
|
||||
} from 'wherehows-web/tests/helpers/login/page-element-constants';
|
||||
|
||||
const appLogin = async () => {
|
||||
await visit(authenticationUrl);
|
||||
await fillIn(loginUserInput, testUser);
|
||||
await fillIn(loginPasswordInput, testPassword);
|
||||
await click(loginSubmitButton);
|
||||
};
|
||||
|
||||
export default appLogin;
|
Loading…
x
Reference in New Issue
Block a user