diff --git a/packages/web-components/fast-foundation/src/foundation/foundation.spec.ts b/packages/web-components/fast-foundation/src/foundation/foundation.spec.ts index b3b2b6d5682..b8f105deec6 100644 --- a/packages/web-components/fast-foundation/src/foundation/foundation.spec.ts +++ b/packages/web-components/fast-foundation/src/foundation/foundation.spec.ts @@ -57,6 +57,8 @@ describe("FASTFoundation", () => { console.log(element.$fastController.template, template); await disconnect(); }); + + xit("the template resolved from $fastProvider when a local template property is not set", async () => {}); }); describe("should style with", () => { @@ -78,5 +80,17 @@ describe("FASTFoundation", () => { console.log(element.$fastController.styles, styles); await disconnect(); }); + + xit("the styles resolved from $fastProvider when a local template property is not set", async () => {}); + }); + + it("should resolve a null $fastProvider if no parent FASTProvider exists", async () => { + const { element, connect, disconnect } = await setup("bare-element"); + await connect(); + + expect(element.$fastProvider).to.equal(null); + await disconnect(); }); + + xit("should resolve a provider element to $fastProvider after DOM connection if element has a parent FASTProvider", async () => {}); }); diff --git a/packages/web-components/fast-foundation/src/foundation/foundation.ts b/packages/web-components/fast-foundation/src/foundation/foundation.ts index 04e300c7aa1..4bd2f572726 100644 --- a/packages/web-components/fast-foundation/src/foundation/foundation.ts +++ b/packages/web-components/fast-foundation/src/foundation/foundation.ts @@ -26,7 +26,7 @@ export abstract class FASTFoundation extends FASTElement { */ @observable public template: ElementViewTemplate | void | null; - private templateChanged(): void { + protected templateChanged(): void { if (this.template !== undefined) { this.$fastController.template = this.template; } @@ -39,7 +39,7 @@ export abstract class FASTFoundation extends FASTElement { */ @observable public styles: ElementStyles | void | null; - private stylesChanged(): void { + protected stylesChanged(): void { if (this.styles !== undefined) { this.$fastController.styles = this.styles; } @@ -59,7 +59,10 @@ export abstract class FASTFoundation extends FASTElement { return this.$fastProvider?.resolveStylesFor(this) || null; } - connectedCallback() { + /** + * Invoked when element is connected to the DOM. + */ + public connectedCallback() { this.$fastProvider = FASTProvider.resolveProvider(this); super.connectedCallback(); }