Don't ring large groups
This commit is contained in:
parent
1f45bce0a2
commit
3e18a8a337
13 changed files with 144 additions and 44 deletions
|
@ -8,14 +8,12 @@ import * as remoteConfig from '../../RemoteConfig';
|
|||
import {
|
||||
getGroupSizeRecommendedLimit,
|
||||
getGroupSizeHardLimit,
|
||||
getMaxGroupCallRingSize,
|
||||
} from '../../groups/limits';
|
||||
|
||||
describe('group limit utilities', () => {
|
||||
let sinonSandbox: sinon.SinonSandbox;
|
||||
let getRecommendedLimitStub: sinon.SinonStub;
|
||||
let getHardLimitStub: sinon.SinonStub;
|
||||
let getMaxGroupCallRingSizeStub: sinon.SinonStub;
|
||||
|
||||
beforeEach(() => {
|
||||
sinonSandbox = sinon.createSandbox();
|
||||
|
@ -27,9 +25,6 @@ describe('group limit utilities', () => {
|
|||
getHardLimitStub = getValueStub.withArgs(
|
||||
'global.groupsv2.groupSizeHardLimit'
|
||||
);
|
||||
getMaxGroupCallRingSizeStub = getValueStub.withArgs(
|
||||
'global.calling.maxGroupCallRingSize'
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -69,21 +64,4 @@ describe('group limit utilities', () => {
|
|||
assert.strictEqual(getGroupSizeHardLimit(), 123);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getMaxGroupCallRingSize', () => {
|
||||
it('returns 16 if the value in remote config is not defined', () => {
|
||||
getMaxGroupCallRingSizeStub.returns(undefined);
|
||||
assert.strictEqual(getMaxGroupCallRingSize(), 16);
|
||||
});
|
||||
|
||||
it('returns 16 if the value in remote config is not a parseable integer', () => {
|
||||
getMaxGroupCallRingSizeStub.returns('uh oh');
|
||||
assert.strictEqual(getMaxGroupCallRingSize(), 16);
|
||||
});
|
||||
|
||||
it('returns the value in remote config, parsed as an integer', () => {
|
||||
getMaxGroupCallRingSizeStub.returns('123');
|
||||
assert.strictEqual(getMaxGroupCallRingSize(), 123);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue