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

Function assertColorOn

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

Source from the content-addressed store, hash-verified

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

Callers 3

validateListFieldsFunction · 0.85
assertFieldErrorStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected