Skip to content

Commit

Permalink
Update _entityFile_.spec.js.ejs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Jun 8, 2024
1 parent 801f740 commit 16ee82a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%_ if (anyFieldIsDateDerived) { _%>
const jestExpect = require('expect');
const { expect: jestExpect } = require('expect');
<%_ } _%>
const {
reloadApp,
Expand Down Expand Up @@ -137,10 +137,10 @@ describe<%- authenticationTypeOauth2 ? '.skip' : '' %>('<%= entityNameCapitalize
await expect(element(by.id('<%= field.fieldName %>'))).toHaveLabel('<%= createFakeData[field.fieldName] %>')
<%_ } else if (formFieldType === 'date') { _%>
const <%= field.fieldName %>CreateAttributes = await element(by.id('<%= field.fieldName %>')).getAttributes();
expect(Date.parse(<%= field.fieldName %>CreateAttributes.label)).toEqual(Date.parse('<%= new Date(createFakeData[field.fieldName]).toCustomLocalDate() %>'));
jestExpect(Date.parse(<%= field.fieldName %>CreateAttributes.label)).toEqual(Date.parse('<%= new Date(createFakeData[field.fieldName]).toCustomLocalDate() %>'));
<%_ } else if (formFieldType === 'datetime') { _%>
const <%= field.fieldName %>CreateAttributes = await element(by.id('<%= field.fieldName %>')).getAttributes();
expect(Date.parse(<%= field.fieldName %>CreateAttributes.label)).toEqual(Date.parse('<%= new Date(createFakeData[field.fieldName]).toFullISOString() %>'));
jestExpect(Date.parse(<%= field.fieldName %>CreateAttributes.label)).toEqual(Date.parse('<%= new Date(createFakeData[field.fieldName]).toFullISOString() %>'));
<%_ } else if (formFieldType === 'boolean') { _%>
await expect(element(by.id('<%= field.fieldName %>'))).toHaveLabel('<%= createFakeData[field.fieldName] %>')
<%_ } else if (formFieldType === 'select-one') { _%>
Expand Down

0 comments on commit 16ee82a

Please sign in to comment.