diff --git a/plugins/sentry-backend/src/service/sentry-api.test.ts b/plugins/sentry-backend/src/service/sentry-api.test.ts index fd4c2581b5..6473c58a10 100644 --- a/plugins/sentry-backend/src/service/sentry-api.test.ts +++ b/plugins/sentry-backend/src/service/sentry-api.test.ts @@ -14,13 +14,7 @@ * limitations under the License. */ import { SentryApiForwarder } from './sentry-api'; -import axios from 'axios'; -jest.mock('axios', () => ({ - default: { - post: jest.fn(), - }, -})); describe('SentryApiForwarder', () => { it('should generate headers based on token passed in constructor', () => { const forwarder = new SentryApiForwarder('testtoken'); diff --git a/plugins/sentry/dev/index.tsx b/plugins/sentry/dev/index.tsx new file mode 100644 index 0000000000..812a5585d4 --- /dev/null +++ b/plugins/sentry/dev/index.tsx @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { createDevApp } from '@backstage/dev-utils'; +import { plugin } from '../src/plugin'; + +createDevApp().registerPlugin(plugin).render(); diff --git a/plugins/sentry/src/components/ErrorCell/ErrorCell.test.tsx b/plugins/sentry/src/components/ErrorCell/ErrorCell.test.tsx index 0daa36f32b..74f1501225 100644 --- a/plugins/sentry/src/components/ErrorCell/ErrorCell.test.tsx +++ b/plugins/sentry/src/components/ErrorCell/ErrorCell.test.tsx @@ -17,7 +17,7 @@ import { ErrorCell } from './ErrorCell'; import React from 'react'; import { render } from '@testing-library/react'; import mockIssue from '../../data/sentry-issue-mock.json'; -import { ThemeProvider } from '@material-ui/styles'; +import { ThemeProvider } from '@material-ui/core'; import { lightTheme } from '@backstage/theme'; describe('Sentry error cell component', () => { diff --git a/plugins/sentry/src/components/ErrorCell/ErrorCell.tsx b/plugins/sentry/src/components/ErrorCell/ErrorCell.tsx index 42ab27e839..408014b790 100644 --- a/plugins/sentry/src/components/ErrorCell/ErrorCell.tsx +++ b/plugins/sentry/src/components/ErrorCell/ErrorCell.tsx @@ -1,3 +1,18 @@ +/* + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import React, { FC } from 'react'; import { SentryIssue } from '../../data/sentry-issue'; import { Link, Typography } from '@material-ui/core'; @@ -7,7 +22,7 @@ import { BackstageTheme } from '@backstage/theme'; function stripText(text: string, maxLength: number) { return text.length > maxLength ? `${text.substr(0, maxLength)}...` : text; } -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles((theme) => ({ root: { minWidth: 260, position: 'relative', diff --git a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.test.tsx b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.test.tsx index 08159b16fc..4bd231a1e5 100644 --- a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.test.tsx +++ b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.test.tsx @@ -18,7 +18,7 @@ import { render } from '@testing-library/react'; import SentryIssuesTable from './SentryIssuesTable'; import { SentryIssue } from '../../data/sentry-issue'; import mockIssue from '../../data/sentry-issue-mock.json'; -import { ThemeProvider } from '@material-ui/styles'; +import { ThemeProvider } from '@material-ui/core'; import { lightTheme } from '@backstage/theme'; describe('SentryIssuesTable', () => { diff --git a/plugins/sentry/src/data/mock-api.ts b/plugins/sentry/src/data/mock-api.ts index 2eab8e30df..e26cce1762 100644 --- a/plugins/sentry/src/data/mock-api.ts +++ b/plugins/sentry/src/data/mock-api.ts @@ -32,8 +32,7 @@ function getMockIssues(number: number): SentryIssue[] { return new Array(number).fill(0).map(getMockIssue); } export class MockSentryApi implements SentryApi { - fetchIssues(project: string, statsFor: string): Promise { - console.info('Fetching mock responses for', project, statsFor); + fetchIssues(): Promise { return new Promise((resolve) => { setTimeout(() => resolve(getMockIssues(14)), 800); });