Skip to content

Commit

Permalink
style: apply linter to test files
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamr committed Jul 18, 2020
1 parent 4a1be1f commit 338ebca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
return false;
}
6 changes: 3 additions & 3 deletions src/__tests__/w3c.css.box-model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

/*
Expand All @@ -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 }) => (
Expand All @@ -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);
});
});

0 comments on commit 338ebca

Please sign in to comment.