@paper-fe/armstrong
v17.0.0
Published
Frontend testing utilities using Angular & Jest
Downloads
87
Readme
Armstrong
Frontend testing utilities using Angular & Jest
Usage Example
// component
import { Component } from "@angular/core";
@Component({
template: `
<p data-testid="test">halo</p>
<button data-testid="action">Click Me!</button>
`,
// .. rest of metadata here
})
export class MyComponent {}
// spec
import { expectText, click } from "@paper-fe/armstrong/dom";
/**
* ... rest of imports here
*/
describe("MyComponent", () => {
let fixture: ComponentFixture<MyComponent>;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [WithoutDepComponent],
}).compileComponents();
fixture = TestBed.createComponent(MyComponent);
fixture.detectChanges();
});
it("contains halo", () => {
expectText(fixture, "test", "halo");
});
it('handles click', () => {
click(fixture, "action");
// your assertion here
})
});