Skip to content

Commit

Permalink
docs: add test case for #493 (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver authored Oct 14, 2024
1 parent 2cfca82 commit e8ddcf4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions projects/testing-library/tests/issues/issue-493.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { HttpClient, provideHttpClient } from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { Component, input } from '@angular/core';
import { render, screen } from '../../src/public_api';

test('succeeds', async () => {
await render(DummyComponent, {
inputs: {
value: 'test',
},
providers: [provideHttpClientTesting(), provideHttpClient()],
});

expect(screen.getByText('test')).toBeVisible();
});

@Component({
selector: 'atl-dummy',
standalone: true,
imports: [],
template: '<p>{{ value() }}</p>',
})
class DummyComponent {
value = input.required<string>();
// @ts-ignore
constructor(private http: HttpClient) {}
}

0 comments on commit e8ddcf4

Please sign in to comment.