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

Function assertColorOn

cypress/utils/steps.js:76–105  ·  view source on GitHub ↗
(cssProperty, color, opts)

Source from the content-addressed store, hash-verified

74}
75
76function assertColorOn(cssProperty, color, opts) {
77 if (opts.type && opts.type === 'label') {
78 (opts.scope ? opts.scope : cy).contains('label', opts.label).should($el => {
79 expect($el).to.have.css(cssProperty, color);
80 });
81 } else if (opts.type && opts.type === 'field') {
82 // eslint-disable-next-line func-style
83 const assertion = $el => expect($el).to.have.css(cssProperty, color);
84 if (opts.isMarkdown) {
85 (opts.scope ? opts.scope : cy)
86 .contains('label', opts.label)
87 .next()
88 .children()
89 .eq(0)
90 .children()
91 .eq(1)
92 .should(assertion);
93 } else {
94 (opts.scope ? opts.scope : cy)
95 .contains('label', opts.label)
96 .parents()
97 .next()
98 .should(assertion);
99 }
100 } else if (opts.el) {
101 opts.el.should($el => {
102 expect($el).to.have.css(cssProperty, color);
103 });
104 }
105}
106
107function exitEditor() {
108 cy.contains('a', 'Writing in').as('exitEditorLink');

Callers 3

validateListFieldsFunction · 0.85
assertFieldErrorStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected