diff options
author | Devlin Junker <devlin.junker@gmail.com> | 2022-11-22 08:04:56 -1000 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2022-12-01 13:17:21 +0100 |
commit | c61d4bbe1fdc7b441011ecaa5b53fae01c7992e4 (patch) | |
tree | ea42f265158833d705e5c51c5246c3b6ef988459 /tests | |
parent | 5bf64073093bb01b0853ff349bb4d971825c8ccf (diff) |
use single quotes
Signed-off-by: Devlin Junker <devlin.junker@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/javascript/unit/components/AdminSettings.spec.ts | 38 | ||||
-rw-r--r-- | tests/javascript/unit/components/Explore.spec.ts | 20 |
2 files changed, 29 insertions, 29 deletions
diff --git a/tests/javascript/unit/components/AdminSettings.spec.ts b/tests/javascript/unit/components/AdminSettings.spec.ts index 4562df933..91f03e62e 100644 --- a/tests/javascript/unit/components/AdminSettings.spec.ts +++ b/tests/javascript/unit/components/AdminSettings.spec.ts @@ -1,20 +1,20 @@ -import axios from "@nextcloud/axios"; -import { shallowMount, Wrapper } from "@vue/test-utils"; -import { store, localVue } from "../setupStore"; -import { showError, showSuccess } from "@nextcloud/dialogs"; -import { loadState } from "@nextcloud/initial-state"; +import axios from '@nextcloud/axios'; +import { shallowMount, Wrapper } from '@vue/test-utils'; +import { store, localVue } from '../setupStore'; +import { showError, showSuccess } from '@nextcloud/dialogs'; +import { loadState } from '@nextcloud/initial-state'; import 'regenerator-runtime/runtime' // NOTE: Required for testing password-confirmation? -import AdminSettings from "Components/AdminSettings.vue"; +import AdminSettings from 'Components/AdminSettings.vue'; -jest.mock("@nextcloud/axios"); -jest.mock("@nextcloud/initial-state"); -jest.mock("@nextcloud/router"); -jest.mock("@nextcloud/dialogs"); +jest.mock('@nextcloud/axios'); +jest.mock('@nextcloud/initial-state'); +jest.mock('@nextcloud/router'); +jest.mock('@nextcloud/dialogs'); -describe("AdminSettings.vue", () => { - "use strict"; +describe('AdminSettings.vue', () => { + 'use strict'; let wrapper: Wrapper<AdminSettings>; @@ -24,12 +24,12 @@ describe("AdminSettings.vue", () => { wrapper = shallowMount(AdminSettings, { localVue, store}); }); - it("should initialize and fetch settings from state", () => { + it('should initialize and fetch settings from state', () => { expect(loadState).toBeCalledTimes(7); }); - it("should send post with updated settings", async () => { - jest.spyOn(axios, "post").mockResolvedValue({ data: {} }); + it('should send post with updated settings', async () => { + jest.spyOn(axios, 'post').mockResolvedValue({ data: {} }); (wrapper.vm as any).handleResponse = jest.fn() await wrapper.vm.$options?.methods?.update.call(wrapper.vm, 'key', 'val'); @@ -37,20 +37,20 @@ describe("AdminSettings.vue", () => { expect(axios.post).toBeCalledTimes(1); }); - it("should handle bad response", () => { + it('should handle bad response', () => { (showError as any).mockClear(); console.error = jest.fn(); wrapper.vm.$options?.methods?.handleResponse.call(wrapper.vm, { error: true, - errorMessage: "FAIL", + errorMessage: 'FAIL', }); expect(showError).toBeCalledTimes(1); }); - it("should handle success response", () => { + it('should handle success response', () => { wrapper.vm.$options?.methods?.handleResponse.call(wrapper.vm, { - status: "ok", + status: 'ok', }); (global as any).t = jest.fn(); jest.runAllTimers(); diff --git a/tests/javascript/unit/components/Explore.spec.ts b/tests/javascript/unit/components/Explore.spec.ts index 846211913..60833f921 100644 --- a/tests/javascript/unit/components/Explore.spec.ts +++ b/tests/javascript/unit/components/Explore.spec.ts @@ -1,19 +1,19 @@ -import axios from "@nextcloud/axios"; -import { shallowMount } from "@vue/test-utils"; -import { store, localVue } from "../setupStore"; +import axios from '@nextcloud/axios'; +import { shallowMount } from '@vue/test-utils'; +import { store, localVue } from '../setupStore'; -import * as router from "@nextcloud/router"; +import * as router from '@nextcloud/router'; -import Explore from "Components/Explore.vue"; +import Explore from 'Components/Explore.vue'; -jest.mock("@nextcloud/axios"); +jest.mock('@nextcloud/axios'); -describe("Explore.vue", () => { - "use strict"; +describe('Explore.vue', () => { + 'use strict'; - it("should initialize without showing AddFeed Component", () => { + it('should initialize without showing AddFeed Component', () => { (axios as any).get.mockResolvedValue({ data: {} }); - (router as any).generateUrl = jest.fn().mockReturnValue(""); + (router as any).generateUrl = jest.fn().mockReturnValue(''); jest.fn().mockReturnValue const wrapper = shallowMount(Explore, { localVue, store }); |