Skip to content

Commit 4dc35ff

Browse files
committed
adding foundation tests
1 parent 740322b commit 4dc35ff

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

packages/web-components/fast-foundation/src/foundation/foundation.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ describe("FASTFoundation", () => {
5757
console.log(element.$fastController.template, template);
5858
await disconnect();
5959
});
60+
61+
xit("the template resolved from $fastProvider when a local template property is not set", async () => {});
6062
});
6163

6264
describe("should style with", () => {
@@ -78,5 +80,17 @@ describe("FASTFoundation", () => {
7880
console.log(element.$fastController.styles, styles);
7981
await disconnect();
8082
});
83+
84+
xit("the styles resolved from $fastProvider when a local template property is not set", async () => {});
85+
});
86+
87+
it("should resolve a null $fastProvider if no parent FASTProvider exists", async () => {
88+
const { element, connect, disconnect } = await setup("bare-element");
89+
await connect();
90+
91+
expect(element.$fastProvider).to.equal(null);
92+
await disconnect();
8193
});
94+
95+
xit("should resolve a provider element to $fastProvider after DOM connection if element has a parent FASTProvider", async () => {});
8296
});

packages/web-components/fast-foundation/src/foundation/foundation.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export abstract class FASTFoundation extends FASTElement {
2626
*/
2727
@observable
2828
public template: ElementViewTemplate | void | null;
29-
private templateChanged(): void {
29+
protected templateChanged(): void {
3030
if (this.template !== undefined) {
3131
this.$fastController.template = this.template;
3232
}
@@ -39,7 +39,7 @@ export abstract class FASTFoundation extends FASTElement {
3939
*/
4040
@observable
4141
public styles: ElementStyles | void | null;
42-
private stylesChanged(): void {
42+
protected stylesChanged(): void {
4343
if (this.styles !== undefined) {
4444
this.$fastController.styles = this.styles;
4545
}
@@ -59,7 +59,10 @@ export abstract class FASTFoundation extends FASTElement {
5959
return this.$fastProvider?.resolveStylesFor(this) || null;
6060
}
6161

62-
connectedCallback() {
62+
/**
63+
* Invoked when element is connected to the DOM.
64+
*/
65+
public connectedCallback() {
6366
this.$fastProvider = FASTProvider.resolveProvider(this);
6467
super.connectedCallback();
6568
}

0 commit comments

Comments
 (0)