Merge pull request #1503 from theseyi/datahub

Reverts accidental deletion of tests/acceptance/login-test.js, refact…
This commit is contained in:
Seyi Adebajo 2019-10-07 16:05:40 -07:00 committed by GitHub
commit f3727edaac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 19 deletions

View File

@ -42,7 +42,7 @@ export const fields: Array<ISearchEntityRenderProps> = [
displayName: 'owners',
showInFacets: false,
desc: 'The confirmed owners for the dataset',
example: 'owners:jweiner'
example: 'owners:sweaver'
},
{
showInAutoCompletion: true,

View File

@ -1,4 +1,3 @@
<p>By checking this box, you acknowledge that you must keep this {{entityName}} compliance updated even after it is deprecated.</p>
<p>
For more information on how to decommission your {{entityName}}, please follow this link:
<a href={{entityDecommissionWikiLink}} target="_blank" rel="noopener">

View File

@ -19,20 +19,6 @@
<th class="dataset-author-column--narrow">ID Type</th>
<th class="dataset-author-column--wide">
Ownership Type
<a
rel="noopener"
target="_blank"
href="https://iwww.corp.linkedin.com/wiki/cf/display/DWH/Metadata+Acquisition#ProjectOverview-ownership"
>
<sup>
<span
class="glyphicon glyphicon-question-sign"
title="Link to more information"
>
</span>
</sup>
</a>
</th>
<th></th>
</tr>

View File

@ -0,0 +1,59 @@
import { visit, click, find, fillIn, currentURL, settled } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import {
loginContainer,
authenticationUrl,
invalidCredentials,
testUser,
testPasswordInvalid
} from 'wherehows-web/tests/helpers/login/constants';
import {
loginUserInput,
loginPasswordInput,
loginSubmitButton
} from 'wherehows-web/tests/helpers/login/page-element-constants';
module('Acceptance | login', function(hooks) {
setupApplicationTest(hooks);
hooks.beforeEach(async function() {
await visit(authenticationUrl);
});
test('visiting /login', function(assert) {
assert.equal(currentURL(), authenticationUrl, `the current url is ${authenticationUrl}`);
});
test('should render login form', function(assert) {
assert.expect(4);
assert.ok(find(loginContainer), 'should have a login form container');
assert.ok(find('input[type=text]'), 'should have a username text input field');
assert.ok(find('input[type=password]'), 'should have a password text input field');
assert.ok(find('button[type=submit]'), 'should have a submit button');
});
test('should display error message with empty credentials', async function(assert) {
assert.expect(2);
await fillIn(loginUserInput, testUser);
await click(loginSubmitButton);
await settled();
assert.dom('#login-error').hasAnyText('error message element is rendered');
assert.dom('#login-error').hasText(invalidCredentials, 'displays missing or invalid credentials message');
});
test('should display invalid password message with invalid password entered', async function(assert) {
assert.expect(2);
await fillIn(loginUserInput, testUser);
await fillIn(loginPasswordInput, testPasswordInvalid);
await click(loginSubmitButton);
await settled();
assert.dom('#login-error').hasAnyText('error message element is rendered');
assert
.dom('#login-error')
.hasText('Invalid Password', 'displays invalid password message in error message container');
});
});

View File

@ -50,7 +50,7 @@ const createTests = (server: IMirageWherehows): Array<ITestSet> => {
title: 'name:'
},
{
description: 'The confirmed owners for the dataset, e.g.: owners:jweiner',
description: 'The confirmed owners for the dataset, e.g.: owners:sweaver',
text: 'owners:',
title: 'owners:'
},
@ -306,7 +306,7 @@ const createTests = (server: IMirageWherehows): Array<ITestSet> => {
title: 'name:'
},
{
description: 'The confirmed owners for the dataset, e.g.: owners:jweiner',
description: 'The confirmed owners for the dataset, e.g.: owners:sweaver',
text: 'something owners:',
title: 'owners:'
},