context-provider-controller prevents replacement (#519)

* context-provider-controller prevents replacement

* correct import order

* do not re-provide self providing context

* define and test controller-host-test element
This commit is contained in:
Niels Lyngsø
2023-02-15 09:47:00 +01:00
committed by GitHub
parent 81654c95dc
commit 5df2f3a4f1
12 changed files with 177 additions and 21 deletions

View File

@@ -35,7 +35,7 @@ describe('UmbContextProvider', () => {
describe('Unique controllers replace each other', () => {
it('has a host property', () => {
const firstCtrl = new UmbContextProviderController(hostElement, 'my-test-context', contextInstance);
const secondCtrl = new UmbContextProviderController(hostElement, 'my-test-context', contextInstance);
const secondCtrl = new UmbContextProviderController(hostElement, 'my-test-context', new MyClass());
expect(hostElement.hasController(firstCtrl)).to.be.false;
expect(hostElement.hasController(secondCtrl)).to.be.true;