Format
This commit is contained in:
parent
1ee817dc2b
commit
e1a6847c84
|
|
@ -19,10 +19,7 @@ export class WebSocketStore {
|
||||||
}
|
}
|
||||||
this.wsActive = true;
|
this.wsActive = true;
|
||||||
|
|
||||||
const wsUrl = config
|
const wsUrl = config.get('url').replace('http', 'ws').replace('https', 'wss');
|
||||||
.get('url')
|
|
||||||
.replace('http', 'ws')
|
|
||||||
.replace('https', 'wss');
|
|
||||||
const ws = new WebSocket(wsUrl + 'stream?token=' + this.currentUser.token());
|
const ws = new WebSocket(wsUrl + 'stream?token=' + this.currentUser.token());
|
||||||
|
|
||||||
ws.onerror = (e) => {
|
ws.onerror = (e) => {
|
||||||
|
|
|
||||||
|
|
@ -152,13 +152,7 @@ const PanelWrapper: React.SFC<IPanelWrapperProps> = ({
|
||||||
</Typography>
|
</Typography>
|
||||||
{description ? <Typography variant="subtitle1">{description}</Typography> : null}
|
{description ? <Typography variant="subtitle1">{description}</Typography> : null}
|
||||||
<hr />
|
<hr />
|
||||||
<div
|
<div className={name.toLowerCase().trim().replace(/ /g, '-')}>{children}</div>
|
||||||
className={name
|
|
||||||
.toLowerCase()
|
|
||||||
.trim()
|
|
||||||
.replace(/ /g, '-')}>
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -135,9 +135,9 @@ describe('plugin', () => {
|
||||||
it('updates configurer', async () => {
|
it('updates configurer', async () => {
|
||||||
await inDetailPage(1, async () => {
|
await inDetailPage(1, async () => {
|
||||||
expect(
|
expect(
|
||||||
await (await (await page.$('.config-save'))!.getProperty(
|
await (
|
||||||
'disabled'
|
await (await page.$('.config-save'))!.getProperty('disabled')
|
||||||
)).jsonValue()
|
).jsonValue()
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
await page.waitForSelector('.CodeMirror .CodeMirror-code');
|
await page.waitForSelector('.CodeMirror .CodeMirror-code');
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
|
|
@ -155,9 +155,9 @@ describe('plugin', () => {
|
||||||
it('configurer updated', async () => {
|
it('configurer updated', async () => {
|
||||||
await inDetailPage(1, async () => {
|
await inDetailPage(1, async () => {
|
||||||
expect(
|
expect(
|
||||||
await (await (await page.$('.config-save'))!.getProperty(
|
await (
|
||||||
'disabled'
|
await (await page.$('.config-save'))!.getProperty('disabled')
|
||||||
)).jsonValue()
|
).jsonValue()
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
await page.waitForSelector('.CodeMirror .CodeMirror-code > div');
|
await page.waitForSelector('.CodeMirror .CodeMirror-code > div');
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,7 @@ export const newTest = async (pluginsDir = ''): Promise<GotifyTest> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const testPluginDir = (): {dir: string; generator: () => string} => {
|
const testPluginDir = (): {dir: string; generator: () => string} => {
|
||||||
const random = Math.random()
|
const random = Math.random().toString(36).substring(2, 15);
|
||||||
.toString(36)
|
|
||||||
.substring(2, 15);
|
|
||||||
const dirName = 'gotifyplugin_' + random;
|
const dirName = 'gotifyplugin_' + random;
|
||||||
const dir = path.join(testBuildPath, dirName);
|
const dir = path.join(testBuildPath, dirName);
|
||||||
if (!fs.existsSync(dir)) {
|
if (!fs.existsSync(dir)) {
|
||||||
|
|
@ -72,18 +70,14 @@ const testPluginDir = (): {dir: string; generator: () => string} => {
|
||||||
return {
|
return {
|
||||||
dir,
|
dir,
|
||||||
generator: () => {
|
generator: () => {
|
||||||
const randomFn = Math.random()
|
const randomFn = Math.random().toString(36).substring(2, 15);
|
||||||
.toString(36)
|
|
||||||
.substring(2, 15);
|
|
||||||
return path.join(dir, randomFn + '.so');
|
return path.join(dir, randomFn + '.so');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const testFilePath = (): string => {
|
const testFilePath = (): string => {
|
||||||
const random = Math.random()
|
const random = Math.random().toString(36).substring(2, 15);
|
||||||
.toString(36)
|
|
||||||
.substring(2, 15);
|
|
||||||
const filename = 'gotifytest_' + random + windowsPrefix;
|
const filename = 'gotifytest_' + random + windowsPrefix;
|
||||||
return path.join(testBuildPath, filename);
|
return path.join(testBuildPath, filename);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue