|
@@ -10,14 +10,13 @@ import {
|
|
|
} from 'sentry-test/reactTestingLibrary';
|
|
|
|
|
|
import {Group, Organization} from 'sentry/types';
|
|
|
-import {GroupEvents} from 'sentry/views/issueDetails/groupEvents';
|
|
|
+import GroupEvents from 'sentry/views/issueDetails/groupEvents';
|
|
|
|
|
|
let location: Location;
|
|
|
|
|
|
describe('groupEvents', () => {
|
|
|
const requests: {[requestName: string]: jest.Mock} = {};
|
|
|
const baseProps = Object.freeze({
|
|
|
- api: new MockApiClient(),
|
|
|
params: {orgId: 'orgId', groupId: '1'},
|
|
|
route: {},
|
|
|
routeParams: {},
|
|
@@ -123,14 +122,10 @@ describe('groupEvents', () => {
|
|
|
});
|
|
|
|
|
|
it('fetches and renders a table of events', async () => {
|
|
|
- render(
|
|
|
- <GroupEvents
|
|
|
- {...baseProps}
|
|
|
- organization={organization}
|
|
|
- location={{...location, query: {}}}
|
|
|
- />,
|
|
|
- {context: routerContext, organization}
|
|
|
- );
|
|
|
+ render(<GroupEvents {...baseProps} location={{...location, query: {}}} />, {
|
|
|
+ context: routerContext,
|
|
|
+ organization,
|
|
|
+ });
|
|
|
|
|
|
expect(await screen.findByText('id123')).toBeInTheDocument();
|
|
|
|
|
@@ -145,14 +140,10 @@ describe('groupEvents', () => {
|
|
|
});
|
|
|
|
|
|
it('handles search', async () => {
|
|
|
- render(
|
|
|
- <GroupEvents
|
|
|
- {...baseProps}
|
|
|
- organization={organization}
|
|
|
- location={{...location, query: {}}}
|
|
|
- />,
|
|
|
- {context: routerContext, organization}
|
|
|
- );
|
|
|
+ render(<GroupEvents {...baseProps} location={{...location, query: {}}} />, {
|
|
|
+ context: routerContext,
|
|
|
+ organization,
|
|
|
+ });
|
|
|
|
|
|
const list = [
|
|
|
{searchTerm: '', expectedQuery: ''},
|
|
@@ -180,7 +171,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -201,7 +191,6 @@ describe('groupEvents', () => {
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
group={group}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -226,7 +215,6 @@ describe('groupEvents', () => {
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
group={group}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -241,15 +229,12 @@ describe('groupEvents', () => {
|
|
|
});
|
|
|
|
|
|
it('does not make attachments request, async when feature not enabled', async () => {
|
|
|
- const org = initializeOrg();
|
|
|
-
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={org.organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
- {context: routerContext, organization}
|
|
|
+ {context: routerContext, organization: {...organization, features: []}}
|
|
|
);
|
|
|
await waitForElementToBeRemoved(() => screen.queryByTestId('loading-indicator'));
|
|
|
|
|
@@ -262,7 +247,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -278,7 +262,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -312,7 +295,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -345,7 +327,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -362,7 +343,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -385,7 +365,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging'], sort: 'user'}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -403,7 +382,6 @@ describe('groupEvents', () => {
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
group={group}
|
|
|
- organization={organization}
|
|
|
location={{
|
|
|
...location,
|
|
|
query: {
|
|
@@ -436,7 +414,6 @@ describe('groupEvents', () => {
|
|
|
render(
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|
|
@@ -454,7 +431,6 @@ describe('groupEvents', () => {
|
|
|
<GroupEvents
|
|
|
{...baseProps}
|
|
|
group={group}
|
|
|
- organization={organization}
|
|
|
location={{...location, query: {environment: ['prod', 'staging']}}}
|
|
|
/>,
|
|
|
{context: routerContext, organization}
|