From f55ffd3be34d67b942f699d0a9d40d31c5fa1aa8 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 14 Nov 2024 00:01:52 +0000 Subject: [PATCH] Change single to double quote --- tests/layer_manager.spec.ts | 22 ++++++++++----------- tests/layer_manager_row.spec.ts | 34 ++++++++++++++++----------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/layer_manager.spec.ts b/tests/layer_manager.spec.ts index 96696c8643..0c170dc543 100644 --- a/tests/layer_manager.spec.ts +++ b/tests/layer_manager.spec.ts @@ -1,14 +1,14 @@ -import { AnyModel } from '@anywidget/types'; -import '../js/layer_manager'; +import { AnyModel } from "@anywidget/types"; +import "../js/layer_manager"; -import { default as layerManagerRender, LayerManager, LayerManagerModel } from '../js/layer_manager'; -import { FakeAnyModel } from './fake_anywidget'; +import { default as layerManagerRender, LayerManager, LayerManagerModel } from "../js/layer_manager"; +import { FakeAnyModel } from "./fake_anywidget"; -describe('', () => { +describe("", () => { let layerManager: LayerManager; async function makeManager(model: AnyModel) { - const container = document.createElement('div'); + const container = document.createElement("div"); layerManagerRender.render({ model, el: container, experimental: { invoke: () => new Promise(() => [model, []]), @@ -28,21 +28,21 @@ describe('', () => { }); afterEach(() => { - Array.from(document.querySelectorAll('layer-manager')).forEach((el) => { + Array.from(document.querySelectorAll("layer-manager")).forEach((el) => { el.remove(); }) }); - it('can be instantiated.', async () => { - expect(layerManager.shadowRoot?.querySelector('.all-layers-text')).toBeDefined(); + it("can be instantiated.", async () => { + expect(layerManager.shadowRoot?.querySelector(".all-layers-text")).toBeDefined(); }); - it('sets model properties on property change.', async () => { + it("sets model properties on property change.", async () => { const setSpy = spyOn(FakeAnyModel.prototype, "set"); const saveSpy = spyOn(FakeAnyModel.prototype, "save_changes"); layerManager.visible = false; await layerManager.updateComplete; - expect(setSpy).toHaveBeenCalledOnceWith('visible', false); + expect(setSpy).toHaveBeenCalledOnceWith("visible", false); expect(saveSpy).toHaveBeenCalledTimes(1); }); }); \ No newline at end of file diff --git a/tests/layer_manager_row.spec.ts b/tests/layer_manager_row.spec.ts index fadc11fdf8..8557586735 100644 --- a/tests/layer_manager_row.spec.ts +++ b/tests/layer_manager_row.spec.ts @@ -1,13 +1,13 @@ -import { AnyModel } from '@anywidget/types'; -import '../js/layer_manager_row'; -import { default as rowRender, LayerManagerRow, LayerManagerRowModel } from '../js/layer_manager_row'; -import { FakeAnyModel } from './fake_anywidget'; +import { AnyModel } from "@anywidget/types"; +import "../js/layer_manager_row"; +import { default as rowRender, LayerManagerRow, LayerManagerRowModel } from "../js/layer_manager_row"; +import { FakeAnyModel } from "./fake_anywidget"; -describe('', () => { +describe("", () => { let row: LayerManagerRow; async function makeRow(model: AnyModel) { - const container = document.createElement('div'); + const container = document.createElement("div"); rowRender.render({ model, el: container, experimental: { invoke: () => new Promise(() => [model, []]), @@ -21,7 +21,7 @@ describe('', () => { beforeEach(async () => { row = await makeRow(new FakeAnyModel({ - name: 'Test Layer', + name: "Test Layer", visible: true, opacity: 1, is_loading: false, @@ -29,28 +29,28 @@ describe('', () => { }); afterEach(() => { - Array.from(document.querySelectorAll('layer-manager-row')).forEach((el) => { + Array.from(document.querySelectorAll("layer-manager-row")).forEach((el) => { el.remove(); }) }); - it('can be instantiated.', () => { - expect(row.shadowRoot?.querySelector('.layer-name')?.textContent).toContain('Test Layer'); + it("can be instantiated.", () => { + expect(row.shadowRoot?.querySelector(".layer-name")?.textContent).toContain("Test Layer"); }); - it('sets model properties on property change.', async () => { + it("sets model properties on property change.", async () => { const setSpy = spyOn(FakeAnyModel.prototype, "set"); const saveSpy = spyOn(FakeAnyModel.prototype, "save_changes"); row.opacity = 0.5; await row.updateComplete; - expect(setSpy).toHaveBeenCalledOnceWith('opacity', 0.5); + expect(setSpy).toHaveBeenCalledOnceWith("opacity", 0.5); expect(saveSpy).toHaveBeenCalledTimes(1); }); - it('emits model events when clicked.', async () => { + it("emits model events when clicked.", async () => { // Settings button emits an event. const sendSpy = spyOn(FakeAnyModel.prototype, "send"); - (row.shadowRoot?.querySelector('.settings-button') as HTMLButtonElement).click(); + (row.shadowRoot?.querySelector(".settings-button") as HTMLButtonElement).click(); expect(FakeAnyModel.prototype.send).toHaveBeenCalledOnceWith({ type: "click", id: "settings" @@ -59,10 +59,10 @@ describe('', () => { sendSpy.calls.reset(); // Deletion button emits an event. - (row.shadowRoot?.querySelector('.delete-button') as HTMLButtonElement).click(); + (row.shadowRoot?.querySelector(".delete-button") as HTMLButtonElement).click(); await row.updateComplete; - (row.shadowRoot?.querySelector('.confirm-deletion-button') as HTMLButtonElement).click(); - expect(FakeAnyModel.prototype.send).toHaveBeenCalledOnceWith({ + (row.shadowRoot?.querySelector(".confirm-deletion-button") as HTMLButtonElement).click(); + expect(sendSpy).toHaveBeenCalledOnceWith({ type: "click", id: "delete" });