Skip to content

Commit f66b532

Browse files
fix linting
1 parent ef8c18b commit f66b532

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

tests/js/unicorn/init.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
import test from "ava";
2+
import { JSDOM } from "jsdom";
23
import { init } from "../../../src/django_unicorn/static/unicorn/js/unicorn.js";
4+
import { components } from "../../../src/django_unicorn/static/unicorn/js/store.js";
5+
6+
test.beforeEach(() => {
7+
const dom = new JSDOM("<!doctype html><html><body></body></html>");
8+
global.document = dom.window.document;
9+
global.window = dom.window;
10+
global.MutationObserver = dom.window.MutationObserver;
11+
global.Node = dom.window.Node;
12+
global.NodeFilter = dom.window.NodeFilter;
13+
14+
for (const key in components) {
15+
delete components[key];
16+
}
17+
});
18+
19+
test.afterEach(() => {
20+
delete global.document;
21+
delete global.window;
22+
delete global.MutationObserver;
23+
delete global.Node;
24+
delete global.NodeFilter;
25+
});
326

427
test("init unicorn", (t) => {
528
const actual = init("unicorn/", "X-Unicorn", "unicorn", { NAME: "morphdom" });

tests/views/message/test_child_state_propagation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ParentView(UnicornView):
3434
def begin_edit_all(self):
3535
for child in self.children:
3636
if hasattr(child, "is_editing"):
37-
child.is_editing = True
37+
setattr(child, "is_editing", True) # noqa: B010 - ty can't narrow the type after hasattr
3838

3939
def walk(self, page: str):
4040
self.current_page = page

0 commit comments

Comments
 (0)