(cssProperty, color, opts)
| 71 | } |
| 72 | |
| 73 | function 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 | |
| 104 | function exitEditor() { |
| 105 | cy.contains('a', 'Writing in').click(); |
no outgoing calls
no test coverage detected