Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] Fix template-only components clearing #17846

Merged
merged 2 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CAPABILITIES: ComponentCapabilities = {
createCaller: true,
dynamicScope: false,
updateHook: true,
createInstance: false,
createInstance: true,
};

export interface InputComponentState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const ROOT_CAPABILITIES: ComponentCapabilities = {
createCaller: true,
dynamicScope: true,
updateHook: true,
createInstance: false,
createInstance: true,
};

export class RootComponentDefinition implements ComponentDefinition {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const CAPABILITIES: ComponentCapabilities = {
createCaller: false,
dynamicScope: false,
updateHook: false,
createInstance: false,
createInstance: true,
};

export default class TemplateOnlyComponentManager extends AbstractManager<null, OwnedTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,30 @@ moduleFor(

this.assertInnerHTML('hello');
}

['@test it has the correct bounds']() {
this.registerComponent('foo-bar', 'hello');

this.render('outside {{#if this.isShowing}}before {{foo-bar}} after{{/if}} outside', {
isShowing: true,
});

this.assertInnerHTML('outside before hello after outside');

this.assertStableRerender();

runTask(() => this.context.set('isShowing', false));

this.assertInnerHTML('outside <!----> outside');

runTask(() => this.context.set('isShowing', null));

this.assertInnerHTML('outside <!----> outside');

runTask(() => this.context.set('isShowing', true));

this.assertInnerHTML('outside before hello after outside');
}
}
);

Expand Down