Tags: dzonatan/angular-testing-library
Tags
feat: support standalone components (testing-library#297) BREAKING CHANGE: This version requires Angular v14+
fix: wrapper component selector is appended with `atl-` BEFORE: Wrapper component had `wrapper-component` as selector ```ts @component({ selector: 'wrapper-component', template: '' }) class WrapperComponent {} ``` AFTER: Wrapper component has `atl-wrapper-component` as selector ```ts @component({ selector: 'atl-wrapper-component', template: '' }) class WrapperComponent {} ```
fix: wrapper component selector is appended with `atl-` BEFORE: Wrapper component had `wrapper-component` as selector ```ts @component({ selector: 'wrapper-component', template: '' }) class WrapperComponent {} ``` AFTER: Wrapper component has `atl-wrapper-component` as selector ```ts @component({ selector: 'atl-wrapper-component', template: '' }) class WrapperComponent {} ```
feat: remove RenderDirectiveOptions (testing-library#265) BREAKING CHANGE: The template property is removed from the render options. Instead, you can pass it as the first argument of `render. BEFORE: ```ts await render(InputOutputComponent, { // 👇 this is deprecated template: '<app-fixture [value]="47" (sendValue)="sendValue($event)" (clicked)="clicked()"></app-fixture>', componentProperties: { sendValue: sendSpy, }, }); ``` AFTER: ```ts // 👇 Move the template in the first argument await render('<app-fixture [value]="47" (sendValue)="sendValue($event)" (clicked)="clicked()"></app-fixture>', { // 👇 Add the component to declarations declarations: [InputOutputComponent], componentProperties: { sendValue: sendSpy, }, }); ```
feat: add rerender method (testing-library#257) BREAKING CHANGE: `rerender` has been renamed to `change`. The `change` method keeps the current fixture intact and invokes `ngOnChanges`. The new `rerender` method destroys the current component and creates a new instance with the updated properties. BEFORE: ```ts const { rerender } = render(...) rerender({...}) ``` AFTER: ```ts const { change } = render(...) change({...}) ```
PreviousNext