@onehat/ui 0.3.285 → 0.3.286

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.3.285",
3
+ "version": "0.3.286",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -3,7 +3,7 @@ import {
3
3
  getLastPartOfPath,
4
4
  } from './utilities.js';
5
5
  import {
6
- loginAsSuper,
6
+ login,
7
7
  logout,
8
8
  navigateViaTabOrHomeButtonTo,
9
9
  } from './navigation_functions.js';
@@ -394,7 +394,7 @@ export function runClosureTreeControlledManagerScreenCrudTests(model, schema, ne
394
394
  describe(Models + 'Manager', () => {
395
395
 
396
396
  beforeEach(function () {
397
- loginAsSuper();
397
+ login();
398
398
  cy.restoreLocalStorage();
399
399
  cy.url().then((currentUrl) => {
400
400
  if (!currentUrl.endsWith(url)) {
@@ -483,7 +483,7 @@ export function runClosureTreeManagerScreenCrudTests(model, schema, newData, edi
483
483
  describe(Models + 'Manager', () => {
484
484
 
485
485
  beforeEach(function () {
486
- loginAsSuper();
486
+ login();
487
487
  cy.restoreLocalStorage();
488
488
  cy.url().then((currentUrl) => {
489
489
  if (!currentUrl.endsWith(url)) {
@@ -545,7 +545,7 @@ export function runInlineManagerScreenCrudTests(model, schema, newData, editData
545
545
  describe(Models + 'Manager', () => {
546
546
 
547
547
  beforeEach(function () {
548
- loginAsSuper();
548
+ login();
549
549
  cy.restoreLocalStorage();
550
550
  cy.url().then((currentUrl) => {
551
551
  if (!currentUrl.endsWith(url)) {
@@ -597,7 +597,7 @@ export function runManagerScreenCrudTests(model, schema, newData, editData, anci
597
597
  describe(Models + 'Manager', () => {
598
598
 
599
599
  beforeEach(function () {
600
- loginAsSuper();
600
+ login();
601
601
  cy.restoreLocalStorage();
602
602
  cy.url().then((currentUrl) => {
603
603
  if (!currentUrl.endsWith(url)) {
@@ -647,7 +647,7 @@ export function runReportsManagerTests(reportData) {
647
647
  describe('ReportsManager', () => {
648
648
 
649
649
  beforeEach(function () {
650
- loginAsSuper();
650
+ login();
651
651
  cy.url().then((currentUrl) => {
652
652
  if (!currentUrl.endsWith(url)) {
653
653
  navigateViaTabOrHomeButtonTo(url);
@@ -15,7 +15,8 @@ import natsort from 'natsort';
15
15
  import _ from 'lodash';
16
16
  const $ = Cypress.$;
17
17
 
18
- let customFormFunctions = {};
18
+
19
+ export const customFormFunctions = {};
19
20
  export function setCustomFormFunctions(fns) {
20
21
  _.merge(customFormFunctions, fns);
21
22
  }
@@ -11,11 +11,17 @@ import {
11
11
  // /_____/\____/\__, /_/_/ /_/
12
12
  // /____/
13
13
 
14
- export function login(loginIdField, user, password) {
14
+ export function login(loginId = null, password = null) {
15
+ if (!user) {
16
+ loginId = Cypress.env('loginId');
17
+ }
18
+ if (!password) {
19
+ user = Cypress.env('password');
20
+ }
15
21
  cy.visit(Cypress.env('baseUrl') + 'login')
16
22
  .then(() => {
17
- getDomNode(loginIdField).clear();
18
- getDomNode(loginIdField).type(user);
23
+ getDomNode('loginId').clear();
24
+ getDomNode('loginId').type(loginId);
19
25
 
20
26
  getDomNode('password').clear();
21
27
  getDomNode('password').type(password);
@@ -24,9 +30,6 @@ export function login(loginIdField, user, password) {
24
30
  cy.url().should('include', 'home');
25
31
  });
26
32
  }
27
- export function loginAsSuper() {
28
- return login(loginIdField === 'username' ? SUPER_USER : SUPER_EMAIL, SUPER_PASSWORD);
29
- }
30
33
  export function logout() {
31
34
  getDomNode('/logout').click({ force: true });
32
35
  }