add some eslint rules for testing-library use in tests

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-11-16 09:32:58 +01:00
parent fd7ec12ec2
commit cb716004ef
31 changed files with 236 additions and 134 deletions
+7 -7
View File
@@ -64,7 +64,7 @@ export class SplunkOnCallClient implements SplunkOnCallApi {
'proxy',
)}/splunk-on-call/v1/incidents`;
const { incidents } = await this.getByUrl<IncidentsResponse>(url);
const { incidents } = await this.findByUrl<IncidentsResponse>(url);
return incidents;
}
@@ -73,7 +73,7 @@ export class SplunkOnCallClient implements SplunkOnCallApi {
const url = `${await this.config.discoveryApi.getBaseUrl(
'proxy',
)}/splunk-on-call/v1/oncall/current`;
const { teamsOnCall } = await this.getByUrl<OnCallsResponse>(url);
const { teamsOnCall } = await this.findByUrl<OnCallsResponse>(url);
return teamsOnCall;
}
@@ -82,7 +82,7 @@ export class SplunkOnCallClient implements SplunkOnCallApi {
const url = `${await this.config.discoveryApi.getBaseUrl(
'proxy',
)}/splunk-on-call/v1/team`;
const teams = await this.getByUrl<Team[]>(url);
const teams = await this.findByUrl<Team[]>(url);
return teams;
}
@@ -91,7 +91,7 @@ export class SplunkOnCallClient implements SplunkOnCallApi {
const url = `${await this.config.discoveryApi.getBaseUrl(
'proxy',
)}/splunk-on-call/v1/org/routing-keys`;
const { routingKeys } = await this.getByUrl<ListRoutingKeyResponse>(url);
const { routingKeys } = await this.findByUrl<ListRoutingKeyResponse>(url);
return routingKeys;
}
@@ -100,7 +100,7 @@ export class SplunkOnCallClient implements SplunkOnCallApi {
const url = `${await this.config.discoveryApi.getBaseUrl(
'proxy',
)}/splunk-on-call/v2/user`;
const { users } = await this.getByUrl<ListUserResponse>(url);
const { users } = await this.findByUrl<ListUserResponse>(url);
return users;
}
@@ -109,7 +109,7 @@ export class SplunkOnCallClient implements SplunkOnCallApi {
const url = `${await this.config.discoveryApi.getBaseUrl(
'proxy',
)}/splunk-on-call/v1/policies`;
const { policies } = await this.getByUrl<EscalationPolicyResponse>(url);
const { policies } = await this.findByUrl<EscalationPolicyResponse>(url);
return policies;
}
@@ -146,7 +146,7 @@ export class SplunkOnCallClient implements SplunkOnCallApi {
return this.request(url, options);
}
private async getByUrl<T>(url: string): Promise<T> {
private async findByUrl<T>(url: string): Promise<T> {
const options = {
method: 'GET',
headers: {
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Entity } from '@backstage/catalog-model';
import { ApiProvider, ConfigReader } from '@backstage/core-app-api';
import {
@@ -187,7 +188,7 @@ describe('SplunkOnCallCard', () => {
{ timeout: 2000 },
);
const createIncidentButton = await getByText('Create Incident');
const createIncidentButton = getByText('Create Incident');
await act(async () => {
fireEvent.click(createIncidentButton);
});