isBlocked factors in the selector (#894)
* isBlocked factors in the selector * Ensure contains parameter is a node * Fix blockSelector blocking for closest nodes * Fix integration test * adding ignoreCSSAttributes to ignore the addition of certain css attributes * tested ignoreCSSAttributes * Update test snapshot * swapped the wrapping of htmlelement to be element * Fix linter errors * Address MR feedback * Rebase Co-authored-by: Filip <filipslatinac@gmail.com>
This commit is contained in:
@@ -581,7 +581,7 @@ exports[`record captures style property changes 1`] = `
|
||||
\\"source\\": 13,
|
||||
\\"id\\": 9,
|
||||
\\"set\\": {
|
||||
\\"property\\": \\"color\\",
|
||||
\\"property\\": \\"border-color\\",
|
||||
\\"value\\": \\"green\\"
|
||||
},
|
||||
\\"index\\": [
|
||||
|
||||
@@ -385,6 +385,7 @@ describe('record', function (this: ISuite) {
|
||||
|
||||
record({
|
||||
emit: ((window as unknown) as IWindow).emit,
|
||||
ignoreCSSAttributes: new Set(['color']),
|
||||
});
|
||||
|
||||
const styleElement = document.createElement('style');
|
||||
@@ -393,10 +394,18 @@ describe('record', function (this: ISuite) {
|
||||
const styleSheet = <CSSStyleSheet>styleElement.sheet;
|
||||
styleSheet.insertRule('body { background: #000; }');
|
||||
setTimeout(() => {
|
||||
// should be ignored
|
||||
(styleSheet.cssRules[0] as CSSStyleRule).style.setProperty(
|
||||
'color',
|
||||
'green',
|
||||
);
|
||||
|
||||
// should be captured because we did not block it
|
||||
(styleSheet.cssRules[0] as CSSStyleRule).style.setProperty(
|
||||
'border-color',
|
||||
'green',
|
||||
);
|
||||
|
||||
(styleSheet.cssRules[0] as CSSStyleRule).style.removeProperty(
|
||||
'background',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user