From dde0e24e0e68639bfed998531697eb35cc3e7e82 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 15 Jun 2023 11:00:17 +0300 Subject: [PATCH] fix collection doc and test --- client/src/collection.js | 2 +- frontend/test/spec/test.collection.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/collection.js b/client/src/collection.js index 3455bf4b9c..9a395d7230 100644 --- a/client/src/collection.js +++ b/client/src/collection.js @@ -233,7 +233,7 @@ class Collection { /** * Remove models or a model. * - * @param {Model[]|Model} models Models ar a model. + * @param {Model[]|Model|string} models Models, a model or a model ID. * @param {{ * silent?: boolean, * }} [options] Options. diff --git a/frontend/test/spec/test.collection.js b/frontend/test/spec/test.collection.js index d92409c2c0..ba083b38d7 100644 --- a/frontend/test/spec/test.collection.js +++ b/frontend/test/spec/test.collection.js @@ -98,6 +98,11 @@ describe('collection', () => { expect(collection.length).toBe(2); expect(collection.get('2')).toBeUndefined(); + + collection.remove('1'); + + expect(collection.length).toBe(1); + expect(collection.get('1')).toBeUndefined(); }); it('should push', () => {