+ This is the {{ $app.context }} page +
+ diff --git a/src/components/__tests__/Logo.test.ts b/src/components/__tests__/Logo.test.ts new file mode 100644 index 0000000..a7d3436 --- /dev/null +++ b/src/components/__tests__/Logo.test.ts @@ -0,0 +1,11 @@ +import { describe, expect, it } from 'vitest' +import { mount } from '@vue/test-utils' +import Logo from '../Logo.vue' + +describe('Logo Component', () => { + it('should render', () => { + const wrapper = mount(Logo) + + expect(wrapper.html()).toBeTruthy() + }) +}) diff --git a/src/composables/useStorageLocal.ts b/src/composables/useStorageLocal.ts new file mode 100644 index 0000000..50858b0 --- /dev/null +++ b/src/composables/useStorageLocal.ts @@ -0,0 +1,30 @@ +import { storage } from 'webextension-polyfill' +import type { + MaybeRef, + RemovableRef, + StorageLikeAsync, + UseStorageAsyncOptions, +} from '@vueuse/core' +import { + useStorageAsync, +} from '@vueuse/core' + +const storageLocal: StorageLikeAsync = { + removeItem(key: string) { + return storage.local.remove(key) + }, + + setItem(key: string, value: string) { + return storage.local.set({ [key]: value }) + }, + + async getItem(key: string) { + return (await storage.local.get(key))[key] + }, +} + +export const useStorageLocal =