This commit is contained in:
Niels Lyngsø
2023-06-28 14:30:04 +02:00
parent 9b74b1cc2d
commit ac3c2c3c62

View File

@@ -25,7 +25,7 @@ export class UmbTestControllerImplementationElement extends UmbBaseController {
}
}
describe('UmbContextProvider', () => {
describe('UmbController', () => {
type NewType = UmbControllerHostElement;
let hostElement: NewType;
@@ -34,6 +34,26 @@ describe('UmbContextProvider', () => {
hostElement = document.createElement('test-my-controller-host') as UmbControllerHostElement;
});
describe('Public API', () => {
describe('methods', () => {
it('has an getElement method', () => {
expect(hostElement).to.have.property('getElement').that.is.a('function');
});
/*
hasController(controller: UmbController): boolean;
getControllers(filterMethod: (ctrl: UmbController) => boolean): UmbController[];
addController(controller: UmbController): void;
removeControllerByAlias(unique: UmbController['controllerAlias']): void;
removeController(controller: UmbController): void;
hostConnected(): void;
hostDisconnected(): void;
destroy(): void;
*/
});
});
describe('Controllers lifecycle', () => {
it('controller is removed from host when destroyed', () => {
const ctrl = new UmbTestControllerImplementationElement(hostElement, 'my-test-context');