Commit 52a2cf88 authored by Tim Kinnane's avatar Tim Kinnane
Browse files

fix(pretest): Fix setup of private group

parent 90120b4e
......@@ -22,7 +22,7 @@ export declare function lastMessages(roomId: string, count?: number): Promise<IM
/** Create a room for tests and catch the error if it exists already */
export declare function createChannel(name: string, members?: string[], readOnly?: boolean): Promise<IChannelResultAPI>;
/** Create a private group / room and catch if exists already */
export declare function createPrivate(name: string, members?: string[], readOnly?: boolean): Promise<IChannelResultAPI>;
export declare function createPrivate(name: string, members?: string[], readOnly?: boolean): Promise<IGroupResultAPI>;
/** Send message from mock user to channel for tests to listen and respond */
/** @todo Sometimes the post request completes before the change event emits
* the message to the streamer. That's why the interval is used for proof
......
......@@ -181,7 +181,7 @@ function setup() {
console.log(`Test channel (${exports.testChannelName}) exists`);
}
// Verify or create private room for tests
let testPrivateInfo = yield channelInfo({ roomName: exports.testPrivateName });
let testPrivateInfo = yield privateInfo({ roomName: exports.testPrivateName });
if (!testPrivateInfo || !testPrivateInfo.success) {
console.log(`Test private room (${exports.testPrivateName}) not found`);
testPrivateInfo = yield createPrivate(exports.testPrivateName, [
......
This diff is collapsed.
......@@ -59,7 +59,7 @@ export async function createPrivate (
name: string,
members: string[] = [],
readOnly: boolean = false
): Promise<IChannelResultAPI> {
): Promise<IGroupResultAPI> {
return post('groups.create', { name, members, readOnly }, true)
}
......@@ -167,7 +167,7 @@ export async function setup () {
}
// Verify or create private room for tests
let testPrivateInfo = await channelInfo({ roomName: testPrivateName })
let testPrivateInfo = await privateInfo({ roomName: testPrivateName })
if (!testPrivateInfo || !testPrivateInfo.success) {
console.log(`Test private room (${testPrivateName}) not found`)
testPrivateInfo = await createPrivate(testPrivateName, [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment