This commit is contained in:
@@ -54,9 +54,9 @@ CURRENT TODOs
|
||||
todo: Client automated testing
|
||||
- Need several as basis for all future, make sure it's right.
|
||||
|
||||
todo: new widget? how to? from grid?
|
||||
- no obvious way to make a new widget except in picklist or duplicate option
|
||||
todo: new widget
|
||||
- There should be a new option (in addition to duplicate) within the existing widget form because it makes sense to want to make a new one while editing previous one
|
||||
- Plus you could have arrived there from anywhere, don't want to have to reload a big list just to add a new one
|
||||
|
||||
todo: Make errorBoxError message box on all forms a component instead as it's just boilerplate
|
||||
- For consistency and so can change it later at will without re-editing all forms
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
v-if="item.surface"
|
||||
:disabled="item.disabled"
|
||||
@click="clickMenuItem(item)"
|
||||
:data-cy="item.key"
|
||||
>
|
||||
<v-icon :color="item.color ? item.color : ''">
|
||||
{{ item.icon }}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
@@ -36,6 +37,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
@@ -49,6 +51,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
@@ -62,6 +65,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
@@ -77,6 +81,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
@@ -94,6 +99,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
@@ -107,6 +113,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
@@ -120,6 +127,7 @@
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<v-col cols="12" mt-1 mb-2>
|
||||
<v-alert
|
||||
ref="errorbox"
|
||||
data-cy="errorbox"
|
||||
v-show="formState.errorBoxMessage"
|
||||
color="error"
|
||||
icon="fa-exclamation-circle "
|
||||
@@ -30,6 +31,7 @@
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'name')"
|
||||
ref="name"
|
||||
data-cy="name"
|
||||
@input="fieldValueChanged('name')"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
@@ -44,6 +46,7 @@
|
||||
v-model="obj.serial"
|
||||
:readonly="true"
|
||||
:label="t('WidgetSerial')"
|
||||
data-cy="serial"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col
|
||||
@@ -61,6 +64,7 @@
|
||||
:counter="10"
|
||||
:label="t('WidgetCount')"
|
||||
ref="count"
|
||||
data-cy="count"
|
||||
:rules="[form().integerValid(this, 'count')]"
|
||||
:error-messages="form().serverErrors(this, 'count')"
|
||||
@input="fieldValueChanged('count')"
|
||||
@@ -80,6 +84,7 @@
|
||||
:readonly="formState.readOnly"
|
||||
:label="t('WidgetDollarAmount')"
|
||||
ref="dollarAmount"
|
||||
data-cy="dollarAmount"
|
||||
:rules="[
|
||||
form().decimalValid(this, 'dollarAmount'),
|
||||
form().required(this, 'dollarAmount')
|
||||
@@ -95,6 +100,7 @@
|
||||
v-model="obj.startDate"
|
||||
:readonly="formState.readOnly"
|
||||
ref="startDate"
|
||||
data-cy="startDate"
|
||||
:error-messages="form().serverErrors(this, 'startDate')"
|
||||
@input="fieldValueChanged('startDate')"
|
||||
></gz-date-time-picker>
|
||||
@@ -108,6 +114,7 @@
|
||||
v-model="obj.endDate"
|
||||
:readonly="formState.readOnly"
|
||||
ref="endDate"
|
||||
data-cy="endDate"
|
||||
@input="fieldValueChanged('endDate')"
|
||||
></gz-date-time-picker>
|
||||
</v-col>
|
||||
@@ -123,6 +130,7 @@
|
||||
:readonly="formState.readOnly"
|
||||
:label="t('Active')"
|
||||
ref="active"
|
||||
data-cy="active"
|
||||
:error-messages="form().serverErrors(this, 'active')"
|
||||
@change="fieldValueChanged('active')"
|
||||
></v-checkbox>
|
||||
@@ -142,6 +150,7 @@
|
||||
:readonly="formState.readOnly"
|
||||
:label="t('User')"
|
||||
ref="userid"
|
||||
data-cy="userid"
|
||||
:error-messages="form().serverErrors(this, 'userid')"
|
||||
@input="fieldValueChanged('userid')"
|
||||
></gz-pick-list>
|
||||
@@ -162,6 +171,7 @@
|
||||
:readonly="formState.readOnly"
|
||||
:label="t('WidgetUserType')"
|
||||
ref="usertype"
|
||||
data-cy="usertype"
|
||||
:rules="[form().integerValid(this, 'usertype')]"
|
||||
:error-messages="form().serverErrors(this, 'usertype')"
|
||||
@input="fieldValueChanged('usertype')"
|
||||
@@ -175,6 +185,7 @@
|
||||
:label="t('WidgetNotes')"
|
||||
:error-messages="form().serverErrors(this, 'notes')"
|
||||
ref="notes"
|
||||
data-cy="notes"
|
||||
@input="fieldValueChanged('notes')"
|
||||
auto-grow
|
||||
clearable
|
||||
@@ -186,6 +197,7 @@
|
||||
v-model="obj.tags"
|
||||
:readonly="formState.readOnly"
|
||||
ref="tags"
|
||||
data-cy="tags"
|
||||
:error-messages="form().serverErrors(this, 'tags')"
|
||||
@input="fieldValueChanged('tags')"
|
||||
></gz-tag-picker>
|
||||
@@ -198,6 +210,7 @@
|
||||
:readOnly="formState.readOnly"
|
||||
:parentVM="this"
|
||||
ref="customFields"
|
||||
data-cy="customFields"
|
||||
:error-messages="form().serverErrors(this, 'customFields')"
|
||||
@input="fieldValueChanged('customFields')"
|
||||
></gz-custom-fields>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// https://docs.cypress.io/api/introduction/api.html
|
||||
|
||||
describe("Login", () => {
|
||||
it("Successfully logs in navigate and log out", () => {
|
||||
describe("WIDGET", () => {
|
||||
it("Performs all crud ops on widget", () => {
|
||||
cy.visit("/login");
|
||||
|
||||
cy.get("input[name=username]")
|
||||
@@ -13,17 +13,21 @@ describe("Login", () => {
|
||||
.clear()
|
||||
.type(`${Cypress.env("adminpassword")}{enter}`);
|
||||
|
||||
// we should be redirected to /dashboard
|
||||
cy.url().should("include", "/home-dashboard");
|
||||
cy.visit("/widgets/0");
|
||||
cy.url().should("include", "/widgets/0");
|
||||
|
||||
//navigate and confirm
|
||||
//open nav and home menu
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=home]").click();
|
||||
cy.get("[data-cy='nav/home-user-settings']").click();
|
||||
cy.url().should("include", "/home-user-settings");
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get("[data-cy='app:logout']").click();
|
||||
cy.url().should("include", "/login");
|
||||
// // we should be redirected to /dashboard
|
||||
// cy.url().should("include", "/home-dashboard");
|
||||
|
||||
// //navigate and confirm
|
||||
// //open nav and home menu
|
||||
// cy.get("[data-cy=navicon]").click();
|
||||
// cy.get("[data-cy=home]").click();
|
||||
// cy.get("[data-cy='nav/home-user-settings']").click();
|
||||
// cy.url().should("include", "/home-user-settings");
|
||||
// cy.get("[data-cy=contextmenu]").click();
|
||||
// cy.get("[data-cy='app:logout']").click();
|
||||
// cy.url().should("include", "/login");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user