mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-27 13:11:01 -06:00
16 lines
396 B
JavaScript
16 lines
396 B
JavaScript
/// <reference types="cypress" />
|
|
|
|
const unquote = (str) => str.replace(/(^")|("$)/g, '');
|
|
|
|
Cypress.Commands.add(
|
|
'before',
|
|
{
|
|
prevSubject: 'element',
|
|
},
|
|
(element, property) => {
|
|
const win = element[0].ownerDocument.defaultView;
|
|
const before = win.getComputedStyle(element[0], 'before');
|
|
return unquote(before.getPropertyValue(property));
|
|
},
|
|
);
|