1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-30 02:21:17 +03:00

Keep all previously approved widget capabilities when requesting new capabilities (#7340)

This commit is contained in:
Dominik Henneke
2021-12-13 11:34:04 +01:00
committed by GitHub
parent 3b3776222b
commit 908e938996
3 changed files with 19 additions and 4 deletions

View File

@ -14,9 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { iterableDiff, iterableUnion } from "../../src/utils/iterables";
import { iterableDiff, iterableMerge, iterableUnion } from "../../src/utils/iterables";
describe('iterables', () => {
describe('iterableMerge', () => {
it('should return a merged array', () => {
const a = [1, 2, 3];
const b = [1, 2, 4]; // note diff
const result = iterableMerge(a, b);
expect(result).toBeDefined();
expect(result).toHaveLength(4);
expect(result).toEqual([1, 2, 3, 4]);
});
});
describe('iterableUnion', () => {
it('should return a union', () => {
const a = [1, 2, 3];