@ -4,11 +4,13 @@
/// <reference types="cypress" />
/// <reference types="cypress" />
import { taskName , labelName , attrName , textDefaultValue } from '../../support/const' ;
import {
taskName , labelName , attrName , textDefaultValue ,
} from '../../support/const' ;
context ( 'Message in UI when raw labels are wrong.' , ( ) => {
context ( 'Message in UI when raw labels are wrong.' , ( ) => {
const issueId = '1498' ;
const issueId = '1498' ;
le t taskRaw = [
cons t taskRaw = [
{
{
name : labelName ,
name : labelName ,
id : 1 ,
id : 1 ,
@ -45,9 +47,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "name" as a number.' , ( ) => {
it ( 'Label "name" as a number.' , ( ) => {
le t taskRawNameNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawNameNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawNameNumber [ 0 ] . name = 1 ;
taskRawNameNumber [ 0 ] . name = 1 ;
le t jsonNameNumber = JSON . stringify ( taskRawNameNumber ) ;
cons t jsonNameNumber = JSON . stringify ( taskRawNameNumber ) ;
cy . get ( '#labels' ) . type ( jsonNameNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonNameNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -57,9 +59,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "id" as a string.' , ( ) => {
it ( 'Label "id" as a string.' , ( ) => {
le t taskRawLabelString = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawLabelString = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawLabelString [ 0 ] . id = '1' ;
taskRawLabelString [ 0 ] . id = '1' ;
le t jsonLabelString = JSON . stringify ( taskRawLabelString ) ;
cons t jsonLabelString = JSON . stringify ( taskRawLabelString ) ;
cy . get ( '#labels' ) . type ( jsonLabelString , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonLabelString , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -69,9 +71,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "attributes" as a number.' , ( ) => {
it ( 'Label "attributes" as a number.' , ( ) => {
le t taskRawAttrNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawAttrNumber [ 0 ] . attributes = 1 ;
taskRawAttrNumber [ 0 ] . attributes = 1 ;
le t jsonAttrNumber = JSON . stringify ( taskRawAttrNumber ) ;
cons t jsonAttrNumber = JSON . stringify ( taskRawAttrNumber ) ;
cy . get ( '#labels' ) . type ( jsonAttrNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -81,9 +83,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "color" as a number.' , ( ) => {
it ( 'Label "color" as a number.' , ( ) => {
le t taskRawColorNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawColorNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawColorNumber [ 0 ] . color = 1 ;
taskRawColorNumber [ 0 ] . color = 1 ;
le t jsonColorNumber = JSON . stringify ( taskRawColorNumber ) ;
cons t jsonColorNumber = JSON . stringify ( taskRawColorNumber ) ;
cy . get ( '#labels' ) . type ( jsonColorNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonColorNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -93,9 +95,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "attributes id" as a string.' , ( ) => {
it ( 'Label "attributes id" as a string.' , ( ) => {
le t taskRawAttrIdString = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrIdString = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawAttrIdString [ 0 ] . attributes [ 0 ] . id = '1' ;
taskRawAttrIdString [ 0 ] . attributes [ 0 ] . id = '1' ;
le t jsonAttrIdString = JSON . stringify ( taskRawAttrIdString ) ;
cons t jsonAttrIdString = JSON . stringify ( taskRawAttrIdString ) ;
cy . get ( '#labels' ) . type ( jsonAttrIdString , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrIdString , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -106,10 +108,10 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
it ( 'Label "attributes input_type" is incorrect.' , ( ) => {
it ( 'Label "attributes input_type" is incorrect.' , ( ) => {
const inputTypes = [ 'select radio' , 'textt' , 'nnumber' ] ;
const inputTypes = [ 'select radio' , 'textt' , 'nnumber' ] ;
le t taskRawAttrTypeNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrTypeNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
for ( le t type of inputTypes ) {
for ( cons t type of inputTypes ) {
taskRawAttrTypeNumber [ 0 ] . attributes [ 0 ] . input _type = type ;
taskRawAttrTypeNumber [ 0 ] . attributes [ 0 ] . input _type = type ;
le t jsonAttrTypeNumber = JSON . stringify ( taskRawAttrTypeNumber ) ;
cons t jsonAttrTypeNumber = JSON . stringify ( taskRawAttrTypeNumber ) ;
cy . get ( '#labels' ) . type ( jsonAttrTypeNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrTypeNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -121,9 +123,9 @@ context('Message in UI when raw labels are wrong.', () => {
}
}
} ) ;
} ) ;
it ( 'Label "attributes mutable" as a number.' , ( ) => {
it ( 'Label "attributes mutable" as a number.' , ( ) => {
le t taskRawAttrMutableNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrMutableNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawAttrMutableNumber [ 0 ] . attributes [ 0 ] . mutable = 1 ;
taskRawAttrMutableNumber [ 0 ] . attributes [ 0 ] . mutable = 1 ;
le t jsonAttrMutableNumber = JSON . stringify ( taskRawAttrMutableNumber ) ;
cons t jsonAttrMutableNumber = JSON . stringify ( taskRawAttrMutableNumber ) ;
cy . get ( '#labels' ) . type ( jsonAttrMutableNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrMutableNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -133,9 +135,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "attributes values" as a number.' , ( ) => {
it ( 'Label "attributes values" as a number.' , ( ) => {
le t taskRawAttrValuesNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrValuesNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawAttrValuesNumber [ 0 ] . attributes [ 0 ] . values = 1 ;
taskRawAttrValuesNumber [ 0 ] . attributes [ 0 ] . values = 1 ;
le t jsonAttrValueNumber = JSON . stringify ( taskRawAttrValuesNumber ) ;
cons t jsonAttrValueNumber = JSON . stringify ( taskRawAttrValuesNumber ) ;
cy . get ( '#labels' ) . type ( jsonAttrValueNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrValueNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -145,9 +147,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "attributes values" as a array with number.' , ( ) => {
it ( 'Label "attributes values" as a array with number.' , ( ) => {
le t taskRawAttrValuesNumberArr = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrValuesNumberArr = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawAttrValuesNumberArr [ 0 ] . attributes [ 0 ] . values = [ 1 ] ;
taskRawAttrValuesNumberArr [ 0 ] . attributes [ 0 ] . values = [ 1 ] ;
le t jsonAttrValuesNumberArr = JSON . stringify ( taskRawAttrValuesNumberArr ) ;
cons t jsonAttrValuesNumberArr = JSON . stringify ( taskRawAttrValuesNumberArr ) ;
cy . get ( '#labels' ) . type ( jsonAttrValuesNumberArr , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrValuesNumberArr , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -157,9 +159,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "attributes name" as a number.' , ( ) => {
it ( 'Label "attributes name" as a number.' , ( ) => {
le t taskRawAttrNameNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrNameNumber = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawAttrNameNumber [ 0 ] . attributes [ 0 ] . name = 1 ;
taskRawAttrNameNumber [ 0 ] . attributes [ 0 ] . name = 1 ;
le t jsonAttrNameNumber = JSON . stringify ( taskRawAttrNameNumber ) ;
cons t jsonAttrNameNumber = JSON . stringify ( taskRawAttrNameNumber ) ;
cy . get ( '#labels' ) . type ( jsonAttrNameNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrNameNumber , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )
@ -169,9 +171,9 @@ context('Message in UI when raw labels are wrong.', () => {
} ) ;
} ) ;
} ) ;
} ) ;
it ( 'Label "attributes values" as a empty array.' , ( ) => {
it ( 'Label "attributes values" as a empty array.' , ( ) => {
le t taskRawAttrValuesEmptyArr = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
cons t taskRawAttrValuesEmptyArr = JSON . parse ( JSON . stringify ( taskRaw ) ) ;
taskRawAttrValuesEmptyArr [ 0 ] . attributes [ 0 ] . values = [ ] ;
taskRawAttrValuesEmptyArr [ 0 ] . attributes [ 0 ] . values = [ ] ;
le t jsonAttrValuesEmptyArr = JSON . stringify ( taskRawAttrValuesEmptyArr ) ;
cons t jsonAttrValuesEmptyArr = JSON . stringify ( taskRawAttrValuesEmptyArr ) ;
cy . get ( '#labels' ) . type ( jsonAttrValuesEmptyArr , { parseSpecialCharSequences : false } ) ;
cy . get ( '#labels' ) . type ( jsonAttrValuesEmptyArr , { parseSpecialCharSequences : false } ) ;
cy . get ( '.ant-form-item-explain' )
cy . get ( '.ant-form-item-explain' )
. should ( 'exist' )
. should ( 'exist' )