Apply prettier formatting

This commit is contained in:
Michael Weimann
2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
1576 changed files with 65384 additions and 62477 deletions
+25 -14
View File
@@ -14,18 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React from 'react';
import { render } from '@testing-library/react';
import React from "react";
import { render } from "@testing-library/react";
import { tooltipifyLinks } from '../../src/utils/tooltipify';
import PlatformPeg from '../../src/PlatformPeg';
import BasePlatform from '../../src/BasePlatform';
import { tooltipifyLinks } from "../../src/utils/tooltipify";
import PlatformPeg from "../../src/PlatformPeg";
import BasePlatform from "../../src/BasePlatform";
describe('tooltipify', () => {
jest.spyOn(PlatformPeg, 'get')
.mockReturnValue({ needsUrlTooltips: () => true } as unknown as BasePlatform);
describe("tooltipify", () => {
jest.spyOn(PlatformPeg, "get").mockReturnValue({ needsUrlTooltips: () => true } as unknown as BasePlatform);
it('does nothing for empty element', () => {
it("does nothing for empty element", () => {
const { container: root } = render(<div />);
const originalHtml = root.outerHTML;
const containers: Element[] = [];
@@ -34,8 +33,12 @@ describe('tooltipify', () => {
expect(root.outerHTML).toEqual(originalHtml);
});
it('wraps single anchor', () => {
const { container: root } = render(<div><a href="/foo">click</a></div>);
it("wraps single anchor", () => {
const { container: root } = render(
<div>
<a href="/foo">click</a>
</div>,
);
const containers: Element[] = [];
tooltipifyLinks([root], [], containers);
expect(containers).toHaveLength(1);
@@ -45,8 +48,12 @@ describe('tooltipify', () => {
expect(tooltip).toBeDefined();
});
it('ignores node', () => {
const { container: root } = render(<div><a href="/foo">click</a></div>);
it("ignores node", () => {
const { container: root } = render(
<div>
<a href="/foo">click</a>
</div>,
);
const originalHtml = root.outerHTML;
const containers: Element[] = [];
tooltipifyLinks([root], [root.children[0]], containers);
@@ -55,7 +62,11 @@ describe('tooltipify', () => {
});
it("does not re-wrap if called multiple times", () => {
const { container: root } = render(<div><a href="/foo">click</a></div>);
const { container: root } = render(
<div>
<a href="/foo">click</a>
</div>,
);
const containers: Element[] = [];
tooltipifyLinks([root], [], containers);
tooltipifyLinks([root], [], containers);