Skip to content

Commit a7c71f9

Browse files
Add tests for visibility
1 parent 2b53b09 commit a7c71f9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/rendered-observer.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export default {
3939
if (this.data.method) {
4040
target[property](element);
4141
}
42+
else if (this.data.style) {
43+
target.style[property] = value;
44+
}
4245
else {
4346
target[property] = value;
4447
}
@@ -163,5 +166,18 @@ export default {
163166
},
164167
],
165168
},
169+
{
170+
name: "Visibility",
171+
data: {
172+
style: true,
173+
},
174+
tests: [{from: "block", to: "none"}, {from: "none", to: "block"}].map(({ from, to }) => {
175+
let DOM = `<div id="element" style="display: ${from}">Element content</div>`;
176+
return {
177+
name: `Change from “${from}” to “${to}”`,
178+
args: [DOM, "element", "display", to],
179+
};
180+
}),
181+
}
166182
],
167183
};

0 commit comments

Comments
 (0)