(cssProperty, color, opts)
| 74 | } |
| 75 | |
| 76 | function 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 | |
| 107 | function exitEditor() { |
| 108 | cy.contains('a', 'Writing in').as('exitEditorLink'); |
no outgoing calls
no test coverage detected