MCPcopy Create free account
hub / github.com/decaporg/decap-cms / validateListFields

Function validateListFields

cypress/utils/steps.js:481–502  ·  view source on GitHub ↗
({ name, description })

Source from the content-addressed store, hash-verified

479}
480
481function validateListFields({ name, description }) {
482 cy.get('a[href^="#/collections/settings"]').click();
483 cy.get('a[href^="#/collections/settings/entries/authors"]').click();
484 cy.contains('button', 'Add').click();
485 cy.contains('button', 'Save').click();
486 assertNotification(notifications.error.missingField);
487 assertFieldErrorStatus('Authors', colorError);
488 cy.get('div[class*=SortableListItem]').eq(2).as('listControl');
489 assertFieldErrorStatus('Name', colorError, { scope: cy.get('@listControl') });
490 assertColorOn('background-color', colorError, {
491 type: 'label',
492 label: 'Description',
493 scope: cy.get('@listControl'),
494 isMarkdown: true,
495 });
496 assertListControlErrorStatus([colorError, colorError], '@listControl');
497 cy.get('input').eq(2).type(name);
498 cy.getMarkdownEditor().eq(2).type(description);
499 flushClockAndSave();
500 assertNotification(notifications.saved);
501 assertFieldErrorStatus('Authors', colorNormal);
502}
503
504function validateNestedListFields() {
505 cy.get('a[href^="#/collections/settings"]').click();

Callers 1

Calls 6

assertNotificationFunction · 0.85
assertFieldErrorStatusFunction · 0.85
assertColorOnFunction · 0.85
flushClockAndSaveFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected