From 77b68e8d03cea822c36d7b16540ed59e2015e26b Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 21 Aug 2024 13:07:01 +0200 Subject: [PATCH] Update sorter.controller.test.ts --- .../core/sorter/sorter.controller.test.ts | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.test.ts b/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.test.ts index 1bb49a8c9a..4b68007e03 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.test.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.test.ts @@ -55,9 +55,70 @@ describe('UmbSorterController', () => { it('is defined with its own instance', () => { expect(element).to.be.instanceOf(UmbSorterTestElement); + expect(element.sorter).to.be.instanceOf(UmbSorterController); }); - describe('Set up', () => { + describe('Public API', () => { + describe('methods', () => { + it('has a enable method', () => { + expect(element.sorter).to.have.property('enable').that.is.a('function'); + }); + + it('has a disable method', () => { + expect(element.sorter).to.have.property('disable').that.is.a('function'); + }); + + it('has a setModel method', () => { + expect(element.sorter).to.have.property('setModel').that.is.a('function'); + }); + + it('has a hasItem method', () => { + expect(element.sorter).to.have.property('hasItem').that.is.a('function'); + }); + + it('has a getItem method', () => { + expect(element.sorter).to.have.property('getItem').that.is.a('function'); + }); + + it('has a setupItem method', () => { + expect(element.sorter).to.have.property('setupItem').that.is.a('function'); + }); + + it('has a destroyItem method', () => { + expect(element.sorter).to.have.property('destroyItem').that.is.a('function'); + }); + + it('has a hasOtherItemsThan method', () => { + expect(element.sorter).to.have.property('hasOtherItemsThan').that.is.a('function'); + }); + + it('has a moveItemInModel method', () => { + expect(element.sorter).to.have.property('moveItemInModel').that.is.a('function'); + }); + + it('has a updateAllowIndication method', () => { + expect(element.sorter).to.have.property('updateAllowIndication').that.is.a('function'); + }); + + it('has a removeAllowIndication method', () => { + expect(element.sorter).to.have.property('removeAllowIndication').that.is.a('function'); + }); + + it('has a notifyDisallowed method', () => { + expect(element.sorter).to.have.property('notifyDisallowed').that.is.a('function'); + }); + + it('has a notifyRequestDrop method', () => { + expect(element.sorter).to.have.property('notifyRequestDrop').that.is.a('function'); + }); + + it('has a destroy method', () => { + expect(element.sorter).to.have.property('destroy').that.is.a('function'); + }); + }); + }); + + describe('Init', () => { it('should find all items', () => { const items = element.getAllItems(); expect(items.length).to.equal(4);