From 95cc71d407b4bf058faee4ef667592043cd67078 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Tue, 24 Sep 2019 09:35:30 -0700 Subject: [PATCH 1/2] Reverts accidental deletion of tests/acceptance/login-test.js, refactors and converts to ts --- .../tests/acceptance/login-test.ts | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 datahub-web/packages/data-portal/tests/acceptance/login-test.ts diff --git a/datahub-web/packages/data-portal/tests/acceptance/login-test.ts b/datahub-web/packages/data-portal/tests/acceptance/login-test.ts new file mode 100644 index 0000000000..5ab1dacd24 --- /dev/null +++ b/datahub-web/packages/data-portal/tests/acceptance/login-test.ts @@ -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'); + }); +}); From 8f1f786e2a246e391074e12fb4a152a8abc7df21 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Mon, 7 Oct 2019 12:08:35 -0700 Subject: [PATCH 2/2] Miscellaneous fixes from last meeting on OSS --- .../data-models/addon/entity/dataset/fields.ts | 2 +- .../entity-deprecation/default-acknowledgement.hbs | 3 +-- .../app/templates/components/dataset-authors.hbs | 14 -------------- .../tests/unit/utils/parsers/autocomplete-test.ts | 4 ++-- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/datahub-web/@datahub/data-models/addon/entity/dataset/fields.ts b/datahub-web/@datahub/data-models/addon/entity/dataset/fields.ts index 05bf5d95c4..988368dc57 100644 --- a/datahub-web/@datahub/data-models/addon/entity/dataset/fields.ts +++ b/datahub-web/@datahub/data-models/addon/entity/dataset/fields.ts @@ -42,7 +42,7 @@ export const fields: Array = [ displayName: 'owners', showInFacets: false, desc: 'The confirmed owners for the dataset', - example: 'owners:jweiner' + example: 'owners:sweaver' }, { showInAutoCompletion: true, diff --git a/datahub-web/@datahub/entity-deprecation/app/templates/partials/entity-deprecation/default-acknowledgement.hbs b/datahub-web/@datahub/entity-deprecation/app/templates/partials/entity-deprecation/default-acknowledgement.hbs index 721d6b6489..70c276a98d 100644 --- a/datahub-web/@datahub/entity-deprecation/app/templates/partials/entity-deprecation/default-acknowledgement.hbs +++ b/datahub-web/@datahub/entity-deprecation/app/templates/partials/entity-deprecation/default-acknowledgement.hbs @@ -1,7 +1,6 @@ -

By checking this box, you acknowledge that you must keep this {{entityName}} compliance updated even after it is deprecated.

For more information on how to decommission your {{entityName}}, please follow this link: {{capitalize entityName}} Decommission -

\ No newline at end of file +

diff --git a/datahub-web/packages/data-portal/app/templates/components/dataset-authors.hbs b/datahub-web/packages/data-portal/app/templates/components/dataset-authors.hbs index 5d4a539e02..1ee74904f8 100644 --- a/datahub-web/packages/data-portal/app/templates/components/dataset-authors.hbs +++ b/datahub-web/packages/data-portal/app/templates/components/dataset-authors.hbs @@ -19,20 +19,6 @@ ID Type Ownership Type - - - - - - - diff --git a/datahub-web/packages/data-portal/tests/unit/utils/parsers/autocomplete-test.ts b/datahub-web/packages/data-portal/tests/unit/utils/parsers/autocomplete-test.ts index 88f45ccf77..8a35d6dfb5 100644 --- a/datahub-web/packages/data-portal/tests/unit/utils/parsers/autocomplete-test.ts +++ b/datahub-web/packages/data-portal/tests/unit/utils/parsers/autocomplete-test.ts @@ -50,7 +50,7 @@ const createTests = (server: IMirageWherehows): Array => { 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 => { 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:' },