This commit is contained in:
Jannis Mattheis 2020-05-08 12:47:13 +02:00
parent 1ee817dc2b
commit e1a6847c84
4 changed files with 11 additions and 26 deletions

View File

@ -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) => {

View File

@ -152,13 +152,7 @@ const PanelWrapper: React.SFC<IPanelWrapperProps> = ({
</Typography>
{description ? <Typography variant="subtitle1">{description}</Typography> : null}
<hr />
<div
className={name
.toLowerCase()
.trim()
.replace(/ /g, '-')}>
{children}
</div>
<div className={name.toLowerCase().trim().replace(/ /g, '-')}>{children}</div>
</Container>
);
};

View File

@ -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(

View File

@ -61,9 +61,7 @@ export const newTest = async (pluginsDir = ''): Promise<GotifyTest> => {
};
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);
};