snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { isFederationAddServerProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('FederationAddServerProps (definition/rest/v1)', () => {
|
||||
describe('isFederationAddServerProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isFederationAddServerProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an FederationAddServerProps', () => {
|
||||
assert.isFalse(isFederationAddServerProps(undefined));
|
||||
assert.isFalse(isFederationAddServerProps(null));
|
||||
assert.isFalse(isFederationAddServerProps(''));
|
||||
assert.isFalse(isFederationAddServerProps(123));
|
||||
assert.isFalse(isFederationAddServerProps({}));
|
||||
assert.isFalse(isFederationAddServerProps([]));
|
||||
assert.isFalse(isFederationAddServerProps(new Date()));
|
||||
assert.isFalse(isFederationAddServerProps(new Error()));
|
||||
});
|
||||
|
||||
it('should return false if serverName is not provided to FederationAddServerProps', () => {
|
||||
assert.isFalse(isFederationAddServerProps({}));
|
||||
});
|
||||
|
||||
it('should accept a serverName with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isFederationAddServerProps({
|
||||
serverName: 'serverName',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to FederationAddServerProps', () => {
|
||||
assert.isFalse(
|
||||
isFederationAddServerProps({
|
||||
serverName: 'serverName',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
import { isFederationJoinExternalPublicRoomProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('FederationJoinExternalPublicRoomProps (definition/rest/v1)', () => {
|
||||
describe('isFederationJoinExternalPublicRoomProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isFederationJoinExternalPublicRoomProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an FederationJoinExternalPublicRoomProps', () => {
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps(undefined));
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps(null));
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps(''));
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps(123));
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps({}));
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps([]));
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps(new Date()));
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps(new Error()));
|
||||
});
|
||||
|
||||
it('should return false if externalRoomId is not provided to FederationJoinExternalPublicRoomProps', () => {
|
||||
assert.isFalse(isFederationJoinExternalPublicRoomProps({}));
|
||||
});
|
||||
|
||||
it('should return false if externalRoomId was provided in the wrong format FederationJoinExternalPublicRoomProps', () => {
|
||||
assert.isFalse(
|
||||
isFederationJoinExternalPublicRoomProps({
|
||||
externalRoomId: 'wrongFormatId',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should accept a externalRoomId with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isFederationJoinExternalPublicRoomProps({
|
||||
externalRoomId: '!externalRoomId:server.com',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to FederationJoinExternalPublicRoomProps', () => {
|
||||
assert.isFalse(
|
||||
isFederationJoinExternalPublicRoomProps({
|
||||
externalRoomId: '!externalRoomId:server.com',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
import { isFederationSearchPublicRoomsProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('FederationPublicRoomProps (definition/rest/v1)', () => {
|
||||
describe('isFederationSearchPublicRoomsProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isFederationSearchPublicRoomsProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an FederationPublicRoomProps', () => {
|
||||
assert.isFalse(isFederationSearchPublicRoomsProps(''));
|
||||
assert.isFalse(isFederationSearchPublicRoomsProps(123));
|
||||
});
|
||||
|
||||
it('should accept a externalRoomId with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isFederationSearchPublicRoomsProps({
|
||||
serverName: 'server',
|
||||
roomName: 'roomName',
|
||||
count: '1',
|
||||
pageToken: 'token',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to FederationPublicRoomProps', () => {
|
||||
assert.isFalse(
|
||||
isFederationSearchPublicRoomsProps({
|
||||
serverName: 'server',
|
||||
roomName: 'roomName',
|
||||
count: '1',
|
||||
pageToken: 'token',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,41 @@
|
||||
import { isFederationRemoveServerProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('FederationRemoveServerProps (definition/rest/v1)', () => {
|
||||
describe('isFederationRemoveServerProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isFederationRemoveServerProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an FederationRemoveServerProps', () => {
|
||||
assert.isFalse(isFederationRemoveServerProps(undefined));
|
||||
assert.isFalse(isFederationRemoveServerProps(null));
|
||||
assert.isFalse(isFederationRemoveServerProps(''));
|
||||
assert.isFalse(isFederationRemoveServerProps(123));
|
||||
assert.isFalse(isFederationRemoveServerProps({}));
|
||||
assert.isFalse(isFederationRemoveServerProps([]));
|
||||
assert.isFalse(isFederationRemoveServerProps(new Date()));
|
||||
assert.isFalse(isFederationRemoveServerProps(new Error()));
|
||||
});
|
||||
|
||||
it('should return false if serverName is not provided to FederationRemoveServerProps', () => {
|
||||
assert.isFalse(isFederationRemoveServerProps({}));
|
||||
});
|
||||
|
||||
it('should accept a serverName with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isFederationRemoveServerProps({
|
||||
serverName: 'serverName',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to FederationRemoveServerProps', () => {
|
||||
assert.isFalse(
|
||||
isFederationRemoveServerProps({
|
||||
serverName: 'serverName',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,91 @@
|
||||
import { isTeamsAddMembersProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('TeamsAddMemberProps (definition/rest/v1)', () => {
|
||||
describe('isTeamsAddMembersProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsAddMembersProps);
|
||||
});
|
||||
it('should return false if the parameter is empty', () => {
|
||||
assert.isFalse(isTeamsAddMembersProps({}));
|
||||
});
|
||||
|
||||
it('should return false if teamId is provided but no member was provided', () => {
|
||||
assert.isFalse(isTeamsAddMembersProps({ teamId: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if teamName is provided but no member was provided', () => {
|
||||
assert.isFalse(isTeamsAddMembersProps({ teamName: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if members is provided but no teamId or teamName were provided', () => {
|
||||
assert.isFalse(isTeamsAddMembersProps({ members: [{ userId: '123' }] }));
|
||||
});
|
||||
|
||||
it('should return false if teamName was provided but members are empty', () => {
|
||||
assert.isFalse(isTeamsAddMembersProps({ teamName: '123', members: [] }));
|
||||
});
|
||||
|
||||
it('should return false if teamId was provided but members are empty', () => {
|
||||
assert.isFalse(isTeamsAddMembersProps({ teamId: '123', members: [] }));
|
||||
});
|
||||
|
||||
it('should return false if members with role is provided but no teamId or teamName were provided', () => {
|
||||
assert.isFalse(isTeamsAddMembersProps({ members: [{ userId: '123', roles: ['123'] }] }));
|
||||
});
|
||||
|
||||
it('should return true if members is provided and teamId is provided', () => {
|
||||
assert.isTrue(isTeamsAddMembersProps({ members: [{ userId: '123' }], teamId: '123' }));
|
||||
});
|
||||
|
||||
it('should return true if members is provided and teamName is provided', () => {
|
||||
assert.isTrue(isTeamsAddMembersProps({ members: [{ userId: '123' }], teamName: '123' }));
|
||||
});
|
||||
|
||||
it('should return true if members with role is provided and teamId is provided', () => {
|
||||
assert.isTrue(isTeamsAddMembersProps({ members: [{ userId: '123', roles: ['123'] }], teamId: '123' }));
|
||||
});
|
||||
|
||||
it('should return true if members with role is provided and teamName is provided', () => {
|
||||
assert.isTrue(isTeamsAddMembersProps({ members: [{ userId: '123', roles: ['123'] }], teamName: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if teamName was provided and members contains an invalid property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsAddMembersProps({
|
||||
teamName: '123',
|
||||
members: [{ userId: '123', roles: ['123'], invalid: true }],
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false if teamId was provided and members contains an invalid property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsAddMembersProps({
|
||||
teamId: '123',
|
||||
members: [{ userId: '123', roles: ['123'], invalid: true }],
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false if teamName informed but contains an invalid property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsAddMembersProps({
|
||||
member: [{ userId: '123', roles: ['123'] }],
|
||||
teamName: '123',
|
||||
invalid: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false if teamId informed but contains an invalid property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsAddMembersProps({
|
||||
member: [{ userId: '123', roles: ['123'] }],
|
||||
teamId: '123',
|
||||
invalid: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import { isTeamsConvertToChannelProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('TeamsConvertToChannelProps (definition/rest/v1)', () => {
|
||||
describe('isTeamsConvertToChannelProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsConvertToChannelProps);
|
||||
});
|
||||
it('should return false if neither teamName or teamId is provided', () => {
|
||||
assert.isFalse(isTeamsConvertToChannelProps({}));
|
||||
});
|
||||
|
||||
it('should return true if teamName is provided', () => {
|
||||
assert.isTrue(isTeamsConvertToChannelProps({ teamName: 'teamName' }));
|
||||
});
|
||||
|
||||
it('should return true if teamId is provided', () => {
|
||||
assert.isTrue(isTeamsConvertToChannelProps({ teamId: 'teamId' }));
|
||||
});
|
||||
|
||||
it('should return false if both teamName and teamId are provided', () => {
|
||||
assert.isFalse(isTeamsConvertToChannelProps({ teamName: 'teamName', teamId: 'teamId' }));
|
||||
});
|
||||
|
||||
it('should return false if an additionalProperties is provided', () => {
|
||||
assert.isFalse(
|
||||
isTeamsConvertToChannelProps({
|
||||
teamName: 'teamName',
|
||||
additionalProperties: 'additionalProperties',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
import { isTeamsDeleteProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('TeamsDeleteProps (definition/rest/v1)', () => {
|
||||
describe('isTeamsDeleteProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsDeleteProps);
|
||||
});
|
||||
|
||||
it('should return false if neither teamName or teamId is provided', () => {
|
||||
assert.isFalse(isTeamsDeleteProps({}));
|
||||
});
|
||||
|
||||
it('should return true if teamId is provided', () => {
|
||||
assert.isTrue(isTeamsDeleteProps({ teamId: 'teamId' }));
|
||||
});
|
||||
|
||||
it('should return true if teamName is provided', () => {
|
||||
assert.isTrue(isTeamsDeleteProps({ teamName: 'teamName' }));
|
||||
});
|
||||
|
||||
it('should return false if teamId and roomsToRemove are provided, but roomsToRemove is empty', () => {
|
||||
assert.isFalse(isTeamsDeleteProps({ teamId: 'teamId', roomsToRemove: [] }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and roomsToRemove are provided, but roomsToRemove is empty', () => {
|
||||
assert.isFalse(isTeamsDeleteProps({ teamName: 'teamName', roomsToRemove: [] }));
|
||||
});
|
||||
|
||||
it('should return true if teamId and roomsToRemove are provided', () => {
|
||||
assert.isTrue(isTeamsDeleteProps({ teamId: 'teamId', roomsToRemove: ['roomId'] }));
|
||||
});
|
||||
|
||||
it('should return true if teamName and roomsToRemove are provided', () => {
|
||||
assert.isTrue(isTeamsDeleteProps({ teamName: 'teamName', roomsToRemove: ['roomId'] }));
|
||||
});
|
||||
|
||||
it('should return false if teamId and roomsToRemove are provided, but roomsToRemove is not an array', () => {
|
||||
assert.isFalse(isTeamsDeleteProps({ teamId: 'teamId', roomsToRemove: {} }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and roomsToRemove are provided, but roomsToRemove is not an array', () => {
|
||||
assert.isFalse(isTeamsDeleteProps({ teamName: 'teamName', roomsToRemove: {} }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and rooms are provided but an extra property is provided', () => {
|
||||
assert.isFalse(
|
||||
isTeamsDeleteProps({
|
||||
teamName: 'teamName',
|
||||
roomsToRemove: ['roomsToRemove'],
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false if teamId and rooms are provided but an extra property is provided', () => {
|
||||
assert.isFalse(isTeamsDeleteProps({ teamId: 'teamId', roomsToRemove: ['roomsToRemove'], extra: 'extra' }));
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,62 @@
|
||||
import { isTeamsLeaveProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('TeamsLeaveProps (definition/rest/v1)', () => {
|
||||
describe('isTeamsLeaveProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsLeaveProps);
|
||||
});
|
||||
|
||||
it('should return false if neither teamName or teamId is provided', () => {
|
||||
assert.isFalse(isTeamsLeaveProps({}));
|
||||
});
|
||||
|
||||
it('should return true if teamId is provided', () => {
|
||||
assert.isTrue(isTeamsLeaveProps({ teamId: 'teamId' }));
|
||||
});
|
||||
|
||||
it('should return true if teamName is provided', () => {
|
||||
assert.isTrue(isTeamsLeaveProps({ teamName: 'teamName' }));
|
||||
});
|
||||
|
||||
it('should return false if teamId and roomsToRemove are provided, but roomsToRemove is empty', () => {
|
||||
assert.isFalse(isTeamsLeaveProps({ teamId: 'teamId', rooms: [] }));
|
||||
});
|
||||
|
||||
it('should return true if teamId are provided, but rooms are undefined', () => {
|
||||
assert.isTrue(isTeamsLeaveProps({ teamId: 'teamId', rooms: undefined }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and rooms are provided, but rooms is empty', () => {
|
||||
assert.isFalse(isTeamsLeaveProps({ teamName: 'teamName', rooms: [] }));
|
||||
});
|
||||
|
||||
it('should return true if teamName are provided, but rooms are undefined', () => {
|
||||
assert.isTrue(isTeamsLeaveProps({ teamName: 'teamName', rooms: undefined }));
|
||||
});
|
||||
|
||||
it('should return true if teamId and rooms are provided', () => {
|
||||
assert.isTrue(isTeamsLeaveProps({ teamId: 'teamId', rooms: ['roomId'] }));
|
||||
});
|
||||
|
||||
it('should return true if teamName and rooms are provided', () => {
|
||||
assert.isTrue(isTeamsLeaveProps({ teamName: 'teamName', rooms: ['roomId'] }));
|
||||
});
|
||||
|
||||
it('should return false if teamId and rooms are provided, but rooms is not an array', () => {
|
||||
assert.isFalse(isTeamsLeaveProps({ teamId: 'teamId', rooms: {} }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and rooms are provided, but rooms is not an array', () => {
|
||||
assert.isFalse(isTeamsLeaveProps({ teamName: 'teamName', rooms: {} }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and rooms are provided but an extra property is provided', () => {
|
||||
assert.isFalse(isTeamsLeaveProps({ teamName: 'teamName', rooms: ['rooms'], extra: 'extra' }));
|
||||
});
|
||||
|
||||
it('should return false if teamId and rooms are provided but an extra property is provided', () => {
|
||||
assert.isFalse(isTeamsLeaveProps({ teamId: 'teamId', rooms: ['rooms'], extra: 'extra' }));
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,83 @@
|
||||
import { isTeamsRemoveMemberProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('Teams (definition/rest/v1)', () => {
|
||||
describe('isTeamsRemoveMemberProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsRemoveMemberProps);
|
||||
});
|
||||
it('should return false if parameter is empty', () => {
|
||||
assert.isFalse(isTeamsRemoveMemberProps({}));
|
||||
});
|
||||
it('should return false if teamId is is informed but missing userId', () => {
|
||||
assert.isFalse(isTeamsRemoveMemberProps({ teamId: 'teamId' }));
|
||||
});
|
||||
it('should return false if teamName is is informed but missing userId', () => {
|
||||
assert.isFalse(isTeamsRemoveMemberProps({ teamName: 'teamName' }));
|
||||
});
|
||||
|
||||
it('should return true if teamId and userId are informed', () => {
|
||||
assert.isTrue(isTeamsRemoveMemberProps({ teamId: 'teamId', userId: 'userId' }));
|
||||
});
|
||||
it('should return true if teamName and userId are informed', () => {
|
||||
assert.isTrue(isTeamsRemoveMemberProps({ teamName: 'teamName', userId: 'userId' }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and userId are informed but rooms are empty', () => {
|
||||
assert.isFalse(isTeamsRemoveMemberProps({ teamName: 'teamName', userId: 'userId', rooms: [] }));
|
||||
});
|
||||
|
||||
it('should return true if teamName and userId are informed but rooms are undefined', () => {
|
||||
assert.isTrue(isTeamsRemoveMemberProps({ teamName: 'teamName', userId: 'userId', rooms: undefined }));
|
||||
});
|
||||
|
||||
it('should return false if teamId and userId are informed and rooms are empty', () => {
|
||||
assert.isFalse(isTeamsRemoveMemberProps({ teamId: 'teamId', userId: 'userId', rooms: [] }));
|
||||
});
|
||||
|
||||
it('should return true if teamId and userId are informed but rooms are undefined', () => {
|
||||
assert.isTrue(isTeamsRemoveMemberProps({ teamId: 'teamId', userId: 'userId', rooms: undefined }));
|
||||
});
|
||||
|
||||
it('should return false if teamId and userId are informed but rooms are empty', () => {
|
||||
assert.isFalse(isTeamsRemoveMemberProps({ teamId: 'teamId', userId: 'userId', rooms: [] }));
|
||||
});
|
||||
|
||||
it('should return true if teamId and userId are informed and rooms are informed', () => {
|
||||
assert.isTrue(isTeamsRemoveMemberProps({ teamId: 'teamId', userId: 'userId', rooms: ['room'] }));
|
||||
});
|
||||
|
||||
it('should return false if teamName and userId are informed and rooms are informed but there is an extra property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsRemoveMemberProps({
|
||||
teamName: 'teamName',
|
||||
userId: 'userId',
|
||||
rooms: ['room'],
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false if teamId and userId are informed and rooms are informed but there is an extra property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsRemoveMemberProps({
|
||||
teamId: 'teamId',
|
||||
userId: 'userId',
|
||||
rooms: ['room'],
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false if teamName and userId are informed and rooms are informed but there is an extra property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsRemoveMemberProps({
|
||||
teamName: 'teamName',
|
||||
userId: 'userId',
|
||||
rooms: ['room'],
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
import { isTeamsRemoveRoomProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('TeamsRemoveRoomProps (definition/rest/v1)', () => {
|
||||
describe('isTeamsRemoveRoomProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsRemoveRoomProps);
|
||||
});
|
||||
it('should return false if roomId is not provided', () => {
|
||||
assert.isFalse(isTeamsRemoveRoomProps({}));
|
||||
});
|
||||
it('should return false if roomId is provided but no teamId or teamName were provided', () => {
|
||||
assert.isFalse(isTeamsRemoveRoomProps({ roomId: 'roomId' }));
|
||||
});
|
||||
it('should return false if roomId is provided and teamId is provided', () => {
|
||||
assert.isTrue(isTeamsRemoveRoomProps({ roomId: 'roomId', teamId: 'teamId' }));
|
||||
});
|
||||
it('should return true if roomId is provided and teamName is provided', () => {
|
||||
assert.isTrue(isTeamsRemoveRoomProps({ roomId: 'roomId', teamName: 'teamName' }));
|
||||
});
|
||||
it('should return false if roomId and teamName are provided but an additional property is provided', () => {
|
||||
assert.isFalse(isTeamsRemoveRoomProps({ roomId: 'roomId', teamName: 'teamName', foo: 'bar' }));
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,63 @@
|
||||
import { isTeamsUpdateMemberProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('TeamsUpdateMemberProps (definition/rest/v1)', () => {
|
||||
describe('isTeamsUpdateMemberProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsUpdateMemberProps);
|
||||
});
|
||||
it('should return false if the parameter is empty', () => {
|
||||
assert.isFalse(isTeamsUpdateMemberProps({}));
|
||||
});
|
||||
|
||||
it('should return false if teamId is provided but no member was provided', () => {
|
||||
assert.isFalse(isTeamsUpdateMemberProps({ teamId: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if teamName is provided but no member was provided', () => {
|
||||
assert.isFalse(isTeamsUpdateMemberProps({ teamName: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if member is provided but no teamId or teamName were provided', () => {
|
||||
assert.isFalse(isTeamsUpdateMemberProps({ member: { userId: '123' } }));
|
||||
});
|
||||
|
||||
it('should return false if member with role is provided but no teamId or teamName were provided', () => {
|
||||
assert.isFalse(isTeamsUpdateMemberProps({ member: { userId: '123', roles: ['123'] } }));
|
||||
});
|
||||
|
||||
it('should return true if member is provided and teamId is provided', () => {
|
||||
assert.isTrue(isTeamsUpdateMemberProps({ member: { userId: '123' }, teamId: '123' }));
|
||||
});
|
||||
|
||||
it('should return true if member is provided and teamName is provided', () => {
|
||||
assert.isTrue(isTeamsUpdateMemberProps({ member: { userId: '123' }, teamName: '123' }));
|
||||
});
|
||||
|
||||
it('should return true if member with role is provided and teamId is provided', () => {
|
||||
assert.isTrue(isTeamsUpdateMemberProps({ member: { userId: '123', roles: ['123'] }, teamId: '123' }));
|
||||
});
|
||||
|
||||
it('should return true if member with role is provided and teamName is provided', () => {
|
||||
assert.isTrue(isTeamsUpdateMemberProps({ member: { userId: '123', roles: ['123'] }, teamName: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if teamName was provided and member contains an invalid property', () => {
|
||||
assert.isFalse(isTeamsUpdateMemberProps({ member: { userId: '123', invalid: '123' }, teamName: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if teamId was provided and member contains an invalid property', () => {
|
||||
assert.isFalse(isTeamsUpdateMemberProps({ member: { userId: '123', invalid: '123' }, teamId: '123' }));
|
||||
});
|
||||
|
||||
it('should return false if contains an invalid property', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateMemberProps({
|
||||
member: { userId: '123', roles: ['123'] },
|
||||
teamName: '123',
|
||||
invalid: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,191 @@
|
||||
import { isTeamsUpdateProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('TeamsUpdateMemberProps (definition/rest/v1)', () => {
|
||||
describe('isTeamsUpdateProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isTeamsUpdateProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an TeamsUpdateProps', () => {
|
||||
assert.isFalse(isTeamsUpdateProps(undefined));
|
||||
assert.isFalse(isTeamsUpdateProps(null));
|
||||
assert.isFalse(isTeamsUpdateProps(''));
|
||||
assert.isFalse(isTeamsUpdateProps(123));
|
||||
assert.isFalse(isTeamsUpdateProps({}));
|
||||
assert.isFalse(isTeamsUpdateProps([]));
|
||||
assert.isFalse(isTeamsUpdateProps(new Date()));
|
||||
assert.isFalse(isTeamsUpdateProps(new Error()));
|
||||
});
|
||||
it('should return false when only teamName is provided to TeamsUpdateProps', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when only teamId is provided to TeamsUpdateProps', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamName and data are provided to TeamsUpdateProps but data is an empty object', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
data: {},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamId and data are provided to TeamsUpdateProps but data is an empty object', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
data: {},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamName and data are provided to TeamsUpdateProps but data is not an object', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
data: 'data',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamId and data are provided to TeamsUpdateProps but data is not an object', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
data: 'data',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return true when teamName and data.name are provided to TeamsUpdateProps', () => {
|
||||
assert.isTrue(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
data: {
|
||||
name: 'name',
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return true when teamId and data.name are provided to TeamsUpdateProps', () => {
|
||||
assert.isTrue(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
data: {
|
||||
name: 'name',
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return true when teamName and data.type are provided to TeamsUpdateProps', () => {
|
||||
assert.isTrue(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
data: {
|
||||
type: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return true when teamId and data.type are provided to TeamsUpdateProps', () => {
|
||||
assert.isTrue(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
data: {
|
||||
type: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return true when teamName and data.name and data.type are provided to TeamsUpdateProps', () => {
|
||||
assert.isTrue(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
data: {
|
||||
name: 'name',
|
||||
type: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return true when teamId and data.name and data.type are provided to TeamsUpdateProps', () => {
|
||||
assert.isTrue(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
data: {
|
||||
name: 'name',
|
||||
type: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamName, data.name, data.type are some more extra data are provided to TeamsUpdateProps', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
data: {
|
||||
name: 'name',
|
||||
type: 0,
|
||||
extra: 'extra',
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamId, data.name, data.type are some more extra data are provided to TeamsUpdateProps', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
data: {
|
||||
name: 'name',
|
||||
type: 0,
|
||||
extra: 'extra',
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamName, data.name, data.type are some more extra parameter are provided to TeamsUpdateProps', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamName: 'teamName',
|
||||
extra: 'extra',
|
||||
data: {
|
||||
name: 'name',
|
||||
type: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when teamId, data.name, data.type are some more extra parameter are provided to TeamsUpdateProps', () => {
|
||||
assert.isFalse(
|
||||
isTeamsUpdateProps({
|
||||
teamId: 'teamId',
|
||||
extra: 'extra',
|
||||
data: {
|
||||
name: 'name',
|
||||
type: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
import { isVideoConfCancelProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('VideoConfCancelProps (definition/rest/v1)', () => {
|
||||
describe('isVideoConfCancelProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isVideoConfCancelProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an VideoConfCancelProps', () => {
|
||||
assert.isFalse(isVideoConfCancelProps(undefined));
|
||||
assert.isFalse(isVideoConfCancelProps(null));
|
||||
assert.isFalse(isVideoConfCancelProps(''));
|
||||
assert.isFalse(isVideoConfCancelProps(123));
|
||||
assert.isFalse(isVideoConfCancelProps({}));
|
||||
assert.isFalse(isVideoConfCancelProps([]));
|
||||
assert.isFalse(isVideoConfCancelProps(new Date()));
|
||||
assert.isFalse(isVideoConfCancelProps(new Error()));
|
||||
});
|
||||
it('should return false if callId is not provided to VideoConfCancelProps', () => {
|
||||
assert.isFalse(isVideoConfCancelProps({}));
|
||||
});
|
||||
|
||||
it('should accept a callId with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfCancelProps({
|
||||
callId: 'callId',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to VideoConfCancelProps', () => {
|
||||
assert.isFalse(
|
||||
isVideoConfCancelProps({
|
||||
callId: 'callId',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
import { isVideoConfInfoProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('VideoConfInfoProps (definition/rest/v1)', () => {
|
||||
describe('isVideoConfInfoProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isVideoConfInfoProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an VideoConfInfoProps', () => {
|
||||
assert.isFalse(isVideoConfInfoProps(undefined));
|
||||
assert.isFalse(isVideoConfInfoProps(null));
|
||||
assert.isFalse(isVideoConfInfoProps(''));
|
||||
assert.isFalse(isVideoConfInfoProps(123));
|
||||
assert.isFalse(isVideoConfInfoProps({}));
|
||||
assert.isFalse(isVideoConfInfoProps([]));
|
||||
assert.isFalse(isVideoConfInfoProps(new Date()));
|
||||
assert.isFalse(isVideoConfInfoProps(new Error()));
|
||||
});
|
||||
it('should return false if callId is not provided to VideoConfInfoProps', () => {
|
||||
assert.isFalse(isVideoConfInfoProps({}));
|
||||
});
|
||||
|
||||
it('should accept a callId with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfInfoProps({
|
||||
callId: 'callId',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to VideoConfInfoProps', () => {
|
||||
assert.isFalse(
|
||||
isVideoConfInfoProps({
|
||||
callId: 'callId',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,45 @@
|
||||
import { isVideoConfJoinProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('VideoConfJoinProps (definition/rest/v1)', () => {
|
||||
describe('isVideoConfJoinProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isVideoConfJoinProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an VideoConfJoinProps', () => {
|
||||
assert.isFalse(isVideoConfJoinProps(undefined));
|
||||
assert.isFalse(isVideoConfJoinProps(null));
|
||||
assert.isFalse(isVideoConfJoinProps(''));
|
||||
assert.isFalse(isVideoConfJoinProps(123));
|
||||
assert.isFalse(isVideoConfJoinProps({}));
|
||||
assert.isFalse(isVideoConfJoinProps([]));
|
||||
assert.isFalse(isVideoConfJoinProps(new Date()));
|
||||
assert.isFalse(isVideoConfJoinProps(new Error()));
|
||||
});
|
||||
it('should return false if callId is not provided to VideoConfJoinProps', () => {
|
||||
assert.isFalse(isVideoConfJoinProps({}));
|
||||
});
|
||||
|
||||
it('should accept a callId with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfJoinProps({
|
||||
callId: 'callId',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when provided with an invalid state', () => {
|
||||
assert.isFalse(isVideoConfJoinProps({ callId: 'callId', state: 123 }));
|
||||
assert.isFalse(isVideoConfJoinProps({ callId: 'callId', state: [] }));
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to VideoConfJoinProps', () => {
|
||||
assert.isFalse(
|
||||
isVideoConfJoinProps({
|
||||
callId: 'callId',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,50 @@
|
||||
import { isVideoConfListProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('VideoConfListProps (definition/rest/v1)', () => {
|
||||
describe('isVideoConfListProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isVideoConfListProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an VideoConfListProps', () => {
|
||||
assert.isFalse(isVideoConfListProps(undefined));
|
||||
assert.isFalse(isVideoConfListProps(null));
|
||||
assert.isFalse(isVideoConfListProps(''));
|
||||
assert.isFalse(isVideoConfListProps(123));
|
||||
assert.isFalse(isVideoConfListProps({}));
|
||||
assert.isFalse(isVideoConfListProps([]));
|
||||
assert.isFalse(isVideoConfListProps(new Date()));
|
||||
assert.isFalse(isVideoConfListProps(new Error()));
|
||||
});
|
||||
it('should return false if roomId is not provided to VideoConfListProps', () => {
|
||||
assert.isFalse(isVideoConfListProps({}));
|
||||
});
|
||||
|
||||
it('should accept a roomId with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfListProps({
|
||||
roomId: 'roomId',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should accept the count and offset parameters', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfListProps({
|
||||
roomId: 'roomId',
|
||||
offset: 50,
|
||||
count: 25,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to VideoConfListProps', () => {
|
||||
assert.isFalse(
|
||||
isVideoConfListProps({
|
||||
roomId: 'roomId',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
import { isVideoConfStartProps } from '@rocket.chat/rest-typings';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('VideoConfStartProps (definition/rest/v1)', () => {
|
||||
describe('isVideoConfStartProps', () => {
|
||||
it('should be a function', () => {
|
||||
assert.isFunction(isVideoConfStartProps);
|
||||
});
|
||||
it('should return false when provided anything that is not an VideoConfStartProps', () => {
|
||||
assert.isFalse(isVideoConfStartProps(undefined));
|
||||
assert.isFalse(isVideoConfStartProps(null));
|
||||
assert.isFalse(isVideoConfStartProps(''));
|
||||
assert.isFalse(isVideoConfStartProps(123));
|
||||
assert.isFalse(isVideoConfStartProps({}));
|
||||
assert.isFalse(isVideoConfStartProps([]));
|
||||
assert.isFalse(isVideoConfStartProps(new Date()));
|
||||
assert.isFalse(isVideoConfStartProps(new Error()));
|
||||
});
|
||||
it('should return false if roomId is not provided to VideoConfStartProps', () => {
|
||||
assert.isFalse(isVideoConfStartProps({}));
|
||||
});
|
||||
|
||||
it('should accept a roomId with nothing else', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfStartProps({
|
||||
roomId: 'roomId',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should accept the allowRinging parameter', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfStartProps({
|
||||
roomId: 'roomId',
|
||||
allowRinging: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should accept a roomId with a title', () => {
|
||||
assert.isTrue(
|
||||
isVideoConfStartProps({
|
||||
roomId: 'roomId',
|
||||
title: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should return false when extra parameters are provided to VideoConfStartProps', () => {
|
||||
assert.isFalse(
|
||||
isVideoConfStartProps({
|
||||
roomId: 'roomId',
|
||||
extra: 'extra',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user