Speaking indicator for group calls

Co-authored-by: Peter Thatcher <peter@signal.org>
Co-authored-by: Jim Gustafson <jim@signal.org>
Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
This commit is contained in:
Evan Hahn 2022-02-08 12:30:33 -06:00 committed by GitHub
parent cb5131420f
commit 5ce26eb91a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 482 additions and 42 deletions

View file

@ -1,13 +1,42 @@
// Copyright 2021 Signal Messenger, LLC
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import { remove, toggle } from '../../util/setUtil';
import { isEqual, remove, toggle } from '../../util/setUtil';
describe('set utilities', () => {
const original = new Set([1, 2, 3]);
describe('isEqual', () => {
it('returns false if the sets are different', () => {
const sets = [
new Set([1, 2, 3]),
new Set([1, 2, 3, 4]),
new Set([1, 2]),
new Set([4, 5, 6]),
];
for (const a of sets) {
for (const b of sets) {
if (a !== b) {
assert.isFalse(isEqual(a, b));
}
}
}
});
it('returns true if both arguments are the same set', () => {
const set = new Set([1, 2, 3]);
assert.isTrue(isEqual(set, set));
});
it('returns true if the sets have the same values', () => {
assert.isTrue(isEqual(new Set(), new Set()));
assert.isTrue(isEqual(new Set([1, 2]), new Set([2, 1])));
});
});
describe('remove', () => {
it('accepts zero arguments, returning a new set', () => {
const result = remove(original);