From 338ebcae6470dd7a72cff6cde4512b5ca9829e2d Mon Sep 17 00:00:00 2001 From: "Jules Sam. Randolph" Date: Sat, 18 Jul 2020 18:50:10 -0300 Subject: [PATCH] style: apply linter to test files --- src/__tests__/utils.js | 8 ++++---- src/__tests__/w3c.css.box-model.test.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/__tests__/utils.js b/src/__tests__/utils.js index 7ddd2da60..37b0b7b4d 100644 --- a/src/__tests__/utils.js +++ b/src/__tests__/utils.js @@ -66,10 +66,10 @@ export function expectTranslatedInlineCSSValueToBeInt({ export function elementHasAncestorOfType(element, Type) { let el = element; - while((el = el.parent) != undefined) { + while ((el = el.parent) != null) { if (el.type === Type) { - return true + return true; } } - return false -} \ No newline at end of file + return false; +} diff --git a/src/__tests__/w3c.css.box-model.test.js b/src/__tests__/w3c.css.box-model.test.js index b9ab9e11d..c77471f3c 100644 --- a/src/__tests__/w3c.css.box-model.test.js +++ b/src/__tests__/w3c.css.box-model.test.js @@ -56,7 +56,7 @@ describe("HTML component should honor formatting context of the DOM tree", () => expect(anonymousText.parent).toBe(img.parent); expect(b.parent.children[1]).toBe(img); expect(img.parent.children[2]).toBe(anonymousText); - expect(elementHasAncestorOfType(img, 'Text')).toBe(false); + expect(elementHasAncestorOfType(img, "Text")).toBe(false); }); /* @@ -68,7 +68,7 @@ describe("HTML component should honor formatting context of the DOM tree", () => * Root /-Text(hello world) * \ * \ - * View --HTMLImage + * View --HTMLImage */ it("should cut embedded images inside inline formatting context provided by a custom Text-wrapped renderer into boxes", () => { const Custom = ({ children, ...props }) => ( @@ -90,6 +90,6 @@ describe("HTML component should honor formatting context of the DOM tree", () => ); const img = UNSAFE_getByType(HTMLImage); expect(img.parent.type).toBe("View"); - expect(elementHasAncestorOfType(img, 'Text')).toBe(false); + expect(elementHasAncestorOfType(img, "Text")).toBe(false); }); });