mirror of
https://github.com/vxcontrol/ncform.git
synced 2026-07-19 18:23:32 -04:00
test(ncform-theme-elementui): complete date-picker test cases again
This commit is contained in:
+123
-21
@@ -76,7 +76,7 @@ context('data-picker', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it.only('Simple Props', () => {
|
||||
it('Simple Props', () => {
|
||||
let formSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@@ -112,31 +112,133 @@ context('data-picker', () => {
|
||||
// Declare action elements
|
||||
|
||||
cy.get('label')
|
||||
.contains('name1')
|
||||
.parent()
|
||||
.within(() => {
|
||||
// format
|
||||
cy.get('input').should('have.value', '(2017)12-03');
|
||||
.contains('name1')
|
||||
.parent()
|
||||
.within(() => {
|
||||
// format
|
||||
cy.get('input').should('have.value', '(2017)12-03');
|
||||
|
||||
// clearable
|
||||
cy.get('input').trigger('mouseenter');
|
||||
cy.get('.el-icon-circle-close').click();
|
||||
cy.get('input').should('have.value', '')
|
||||
});
|
||||
// clearable
|
||||
cy.get('input').trigger('mouseenter');
|
||||
cy.get('.el-icon-circle-close').click();
|
||||
cy.get('input').should('have.value', '');
|
||||
});
|
||||
|
||||
cy.get('label')
|
||||
.contains('name2')
|
||||
.parent()
|
||||
.within(() => {
|
||||
// clearable
|
||||
cy.get('input').trigger('mouseenter');
|
||||
cy.wait(100).then(() => {
|
||||
cy.get('.el-icon-circle-close').should('not.be.visible');
|
||||
})
|
||||
});
|
||||
.contains('name2')
|
||||
.parent()
|
||||
.within(() => {
|
||||
// clearable
|
||||
cy.get('input').trigger('mouseenter');
|
||||
cy.wait(100).then(() => {
|
||||
cy.get('.el-icon-circle-close').should('not.be.visible');
|
||||
});
|
||||
});
|
||||
|
||||
// common.submitForm();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it('Type', () => {
|
||||
let formSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name1: {
|
||||
type: 'string',
|
||||
value: '1512284108066',
|
||||
ui: {
|
||||
widget: 'date-picker',
|
||||
widgetConfig: {
|
||||
type: 'year'
|
||||
}
|
||||
}
|
||||
},
|
||||
name2: {
|
||||
type: 'string',
|
||||
value: '1512284108066',
|
||||
ui: {
|
||||
widget: 'date-picker',
|
||||
widgetConfig: {
|
||||
type: 'month'
|
||||
}
|
||||
}
|
||||
},
|
||||
name3: {
|
||||
type: 'string',
|
||||
value: '1512284108066',
|
||||
ui: {
|
||||
widget: 'date-picker',
|
||||
widgetConfig: {
|
||||
type: 'date'
|
||||
}
|
||||
}
|
||||
},
|
||||
name4: {
|
||||
type: 'string',
|
||||
value: '1512284108066',
|
||||
ui: {
|
||||
widget: 'date-picker',
|
||||
widgetConfig: {
|
||||
type: 'week'
|
||||
}
|
||||
}
|
||||
},
|
||||
name5: {
|
||||
type: 'string',
|
||||
value: '1512284108066',
|
||||
ui: {
|
||||
widget: 'date-picker',
|
||||
widgetConfig: {
|
||||
type: 'datetime'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
cy.window()
|
||||
.its('editor')
|
||||
.invoke('setValue', JSON.stringify(formSchema, null, 2));
|
||||
common.startRun();
|
||||
|
||||
cy.get('.previewArea').within(() => {
|
||||
// Declare action elements
|
||||
|
||||
cy.get('label')
|
||||
.contains('name1')
|
||||
.parent()
|
||||
.within(() => {
|
||||
cy.get('input').should('have.value', '2017');
|
||||
});
|
||||
|
||||
cy.get('label')
|
||||
.contains('name2')
|
||||
.parent()
|
||||
.within(() => {
|
||||
cy.get('input').should('have.value', '2017-12');
|
||||
});
|
||||
|
||||
cy.get('label')
|
||||
.contains('name3')
|
||||
.parent()
|
||||
.within(() => {
|
||||
cy.get('input').should('have.value', '2017-12-03');
|
||||
});
|
||||
|
||||
cy.get('label')
|
||||
.contains('name4')
|
||||
.parent()
|
||||
.within(() => {
|
||||
cy.get('input').should('have.value', 'Week 48 of 2017');
|
||||
});
|
||||
|
||||
cy.get('label')
|
||||
.contains('name5')
|
||||
.parent()
|
||||
.within(() => {
|
||||
cy.get('input').should('have.value', '2017-12-03 14:55:08');
|
||||
});
|
||||
|
||||
// common.submitForm();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user