From e1a6847c8443ef622819fcbf375eb1e443fe5056 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Fri, 8 May 2020 12:47:13 +0200 Subject: [PATCH] Format --- ui/src/message/WebSocketStore.ts | 5 +---- ui/src/plugin/PluginDetailView.tsx | 8 +------- ui/src/tests/plugin.test.ts | 12 ++++++------ ui/src/tests/setup.ts | 12 +++--------- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/ui/src/message/WebSocketStore.ts b/ui/src/message/WebSocketStore.ts index fdd022e..48cea8d 100644 --- a/ui/src/message/WebSocketStore.ts +++ b/ui/src/message/WebSocketStore.ts @@ -19,10 +19,7 @@ export class WebSocketStore { } this.wsActive = true; - const wsUrl = config - .get('url') - .replace('http', 'ws') - .replace('https', 'wss'); + const wsUrl = config.get('url').replace('http', 'ws').replace('https', 'wss'); const ws = new WebSocket(wsUrl + 'stream?token=' + this.currentUser.token()); ws.onerror = (e) => { diff --git a/ui/src/plugin/PluginDetailView.tsx b/ui/src/plugin/PluginDetailView.tsx index 3b42481..0685a1f 100644 --- a/ui/src/plugin/PluginDetailView.tsx +++ b/ui/src/plugin/PluginDetailView.tsx @@ -152,13 +152,7 @@ const PanelWrapper: React.SFC = ({ {description ? {description} : null}
-
- {children} -
+
{children}
); }; diff --git a/ui/src/tests/plugin.test.ts b/ui/src/tests/plugin.test.ts index f1978a2..3996012 100644 --- a/ui/src/tests/plugin.test.ts +++ b/ui/src/tests/plugin.test.ts @@ -135,9 +135,9 @@ describe('plugin', () => { it('updates configurer', async () => { await inDetailPage(1, async () => { expect( - await (await (await page.$('.config-save'))!.getProperty( - 'disabled' - )).jsonValue() + await ( + await (await page.$('.config-save'))!.getProperty('disabled') + ).jsonValue() ).toBe(true); await page.waitForSelector('.CodeMirror .CodeMirror-code'); await page.waitForFunction( @@ -155,9 +155,9 @@ describe('plugin', () => { it('configurer updated', async () => { await inDetailPage(1, async () => { expect( - await (await (await page.$('.config-save'))!.getProperty( - 'disabled' - )).jsonValue() + await ( + await (await page.$('.config-save'))!.getProperty('disabled') + ).jsonValue() ).toBe(true); await page.waitForSelector('.CodeMirror .CodeMirror-code > div'); await page.waitForFunction( diff --git a/ui/src/tests/setup.ts b/ui/src/tests/setup.ts index 08f68b7..bb6b3aa 100644 --- a/ui/src/tests/setup.ts +++ b/ui/src/tests/setup.ts @@ -61,9 +61,7 @@ export const newTest = async (pluginsDir = ''): Promise => { }; const testPluginDir = (): {dir: string; generator: () => string} => { - const random = Math.random() - .toString(36) - .substring(2, 15); + const random = Math.random().toString(36).substring(2, 15); const dirName = 'gotifyplugin_' + random; const dir = path.join(testBuildPath, dirName); if (!fs.existsSync(dir)) { @@ -72,18 +70,14 @@ const testPluginDir = (): {dir: string; generator: () => string} => { return { dir, generator: () => { - const randomFn = Math.random() - .toString(36) - .substring(2, 15); + const randomFn = Math.random().toString(36).substring(2, 15); return path.join(dir, randomFn + '.so'); }, }; }; const testFilePath = (): string => { - const random = Math.random() - .toString(36) - .substring(2, 15); + const random = Math.random().toString(36).substring(2, 15); const filename = 'gotifytest_' + random + windowsPrefix; return path.join(testBuildPath, filename); };