run prettier formatting
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -69,9 +69,8 @@ export const AuditListTable = ({ items }: { items: Website[] }) => {
|
||||
const auditStatus = response.lastAudit.status;
|
||||
if (auditStatus === 'COMPLETED' || auditStatus === 'FAILED') {
|
||||
const newWebsiteData = websiteState.slice(0);
|
||||
newWebsiteData[
|
||||
newWebsiteData.findIndex(w => w.url === response.url)
|
||||
] = response;
|
||||
newWebsiteData[newWebsiteData.findIndex(w => w.url === response.url)] =
|
||||
response;
|
||||
setWebsiteState(newWebsiteData);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -37,9 +37,8 @@ import * as data from '../../__fixtures__/website-response.json';
|
||||
import AuditView from './index';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
const { useParams }: { useParams: jest.Mock } = jest.requireMock(
|
||||
'react-router-dom',
|
||||
);
|
||||
const { useParams }: { useParams: jest.Mock } =
|
||||
jest.requireMock('react-router-dom');
|
||||
const websiteResponse = data as Website;
|
||||
|
||||
describe('AuditView', () => {
|
||||
|
||||
@@ -123,7 +123,11 @@ export const AuditViewContent = () => {
|
||||
const classes = useStyles();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { loading, error, value: nextValue } = useAsync(
|
||||
const {
|
||||
loading,
|
||||
error,
|
||||
value: nextValue,
|
||||
} = useAsync(
|
||||
async () => await lighthouseApi.getWebsiteForAuditId(params.id),
|
||||
[params.id],
|
||||
);
|
||||
|
||||
@@ -93,7 +93,9 @@ describe('<LastLighthouseAuditCard />', () => {
|
||||
describe('where a category score is not a number', () => {
|
||||
beforeEach(() => {
|
||||
entityWebsite = { ...entityWebsite };
|
||||
(entityWebsite.lastAudit as AuditCompleted).categories.accessibility.score = NaN;
|
||||
(
|
||||
entityWebsite.lastAudit as AuditCompleted
|
||||
).categories.accessibility.score = NaN;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -35,9 +35,8 @@ import CreateAudit from './index';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
import { ErrorApi, errorApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
const { useNavigate }: { useNavigate: jest.Mock } = jest.requireMock(
|
||||
'react-router-dom',
|
||||
);
|
||||
const { useNavigate }: { useNavigate: jest.Mock } =
|
||||
jest.requireMock('react-router-dom');
|
||||
const createAuditResponse = data as Audit;
|
||||
|
||||
// TODO add act() to these tests without breaking them!
|
||||
|
||||
@@ -27,9 +27,10 @@ export const useWebsiteForEntity = () => {
|
||||
entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION] ?? '';
|
||||
const lighthouseApi = useApi(lighthouseApiRef);
|
||||
const errorApi = useApi(errorApiRef);
|
||||
const response = useAsync(() => lighthouseApi.getWebsiteByUrl(websiteUrl), [
|
||||
websiteUrl,
|
||||
]);
|
||||
const response = useAsync(
|
||||
() => lighthouseApi.getWebsiteByUrl(websiteUrl),
|
||||
[websiteUrl],
|
||||
);
|
||||
if (response.error) {
|
||||
errorApi.post(response.error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user