diff --git a/spec/renderer/integration/store/App.spec.ts b/spec/renderer/integration/store/App.spec.ts index 5a5376f0..15da405a 100644 --- a/spec/renderer/integration/store/App.spec.ts +++ b/spec/renderer/integration/store/App.spec.ts @@ -1,6 +1,6 @@ import { createLocalVue } from '@vue/test-utils' import Vuex from 'vuex' -import { ipcMain } from '~/spec/mock/electron' +import { ipcMain, ipcRenderer } from '~/spec/mock/electron' import App from '@/store/App' import DisplayStyle from '~/src/constants/displayStyle' import { LightTheme, DarkTheme } from '~/src/constants/themeColor' @@ -8,6 +8,7 @@ import Theme from '~/src/constants/theme' import TimeFormat from '~/src/constants/timeFormat' import Language from '~/src/constants/language' import DefaultFonts from '@/utils/fonts' +import { MyWindow } from '~/src/types/global' const state = () => { return { @@ -43,6 +44,7 @@ describe('App', () => { let localVue beforeEach(() => { + ;(window).ipcRenderer = ipcRenderer localVue = createLocalVue() localVue.use(Vuex) store = new Vuex.Store({ @@ -58,11 +60,10 @@ describe('App', () => { ipcMain.once('get-preferences', (event: any, _) => { event.sender.send('error-get-preferences', new Error()) }) - await store.dispatch('App/loadPreferences') - .catch((err) => { - expect(err instanceof Error).toEqual(true) - expect(store.state.App.theme).toEqual(LightTheme) - }) + await store.dispatch('App/loadPreferences').catch(err => { + expect(err instanceof Error).toEqual(true) + expect(store.state.App.theme).toEqual(LightTheme) + }) }) }) describe('success', () => { diff --git a/src/main/preload.js b/src/main/preload.js index 9ecab4db..0b913b3c 100644 --- a/src/main/preload.js +++ b/src/main/preload.js @@ -1,3 +1,5 @@ const electron = require('electron') global.ipcRenderer = electron.ipcRenderer +global.shell = electron.shell +global.clipboard = electron.clipboard global.process = process diff --git a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue index 09232ac0..5271af91 100644 --- a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue +++ b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue @@ -1,114 +1,125 @@