|
@@ -9,6 +9,7 @@ import {
|
|
|
} from 'sentry-test/reactTestingLibrary';
|
|
|
|
|
|
import {GroupEvents} from 'sentry/views/organizationGroupDetails/groupEvents';
|
|
|
+import {RouteContext} from 'sentry/views/routeContext';
|
|
|
|
|
|
describe('groupEvents', function () {
|
|
|
let request;
|
|
@@ -115,13 +116,15 @@ describe('groupEvents', function () {
|
|
|
|
|
|
it('renders', function () {
|
|
|
const wrapper = render(
|
|
|
- <GroupEvents
|
|
|
- organization={organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- group={TestStubs.Group()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- location={{query: {}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ group={TestStubs.Group()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ location={{query: {}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
|
|
@@ -130,13 +133,15 @@ describe('groupEvents', function () {
|
|
|
|
|
|
it('handles search', function () {
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={TestStubs.Group()}
|
|
|
- location={{query: {}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={TestStubs.Group()}
|
|
|
+ location={{query: {}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
|
|
@@ -162,13 +167,15 @@ describe('groupEvents', function () {
|
|
|
|
|
|
it('handles environment filtering', function () {
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={TestStubs.Group()}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={TestStubs.Group()}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
expect(request).toHaveBeenCalledWith(
|
|
@@ -194,13 +201,15 @@ describe('groupEvents', function () {
|
|
|
group.issueCategory = 'performance';
|
|
|
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
expect(discoverRequest).toHaveBeenCalledWith(
|
|
@@ -218,13 +227,15 @@ describe('groupEvents', function () {
|
|
|
group.issueCategory = 'performance';
|
|
|
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
await waitForElementToBeRemoved(document.querySelector('div.loading-indicator'));
|
|
@@ -242,13 +253,15 @@ describe('groupEvents', function () {
|
|
|
|
|
|
it('does not display attachments column with no attachments', async () => {
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
await waitForElementToBeRemoved(document.querySelector('div.loading-indicator'));
|
|
@@ -259,13 +272,15 @@ describe('groupEvents', function () {
|
|
|
|
|
|
it('does not display minidump column with no minidumps', async () => {
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
await waitForElementToBeRemoved(document.querySelector('div.loading-indicator'));
|
|
@@ -294,13 +309,15 @@ describe('groupEvents', function () {
|
|
|
});
|
|
|
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
await waitForElementToBeRemoved(document.querySelector('div.loading-indicator'));
|
|
@@ -329,13 +346,15 @@ describe('groupEvents', function () {
|
|
|
});
|
|
|
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
await waitForElementToBeRemoved(document.querySelector('div.loading-indicator'));
|
|
@@ -348,13 +367,15 @@ describe('groupEvents', function () {
|
|
|
|
|
|
it('renders new events table if error', function () {
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
expect(discoverRequest).toHaveBeenCalledWith(
|
|
@@ -373,13 +394,15 @@ describe('groupEvents', function () {
|
|
|
|
|
|
it('removes sort if unsupported by the events table', function () {
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging'], sort: 'user'}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging'], sort: 'user'}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
expect(discoverRequest).toHaveBeenCalledWith(
|
|
@@ -394,13 +417,15 @@ describe('groupEvents', function () {
|
|
|
const group = TestStubs.Group();
|
|
|
|
|
|
render(
|
|
|
- <GroupEvents
|
|
|
- organization={org.organization}
|
|
|
- api={new MockApiClient()}
|
|
|
- params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
- group={group}
|
|
|
- location={{query: {environment: ['prod', 'staging']}}}
|
|
|
- />,
|
|
|
+ <RouteContext.Provider value={routerContext}>
|
|
|
+ <GroupEvents
|
|
|
+ organization={org.organization}
|
|
|
+ api={new MockApiClient()}
|
|
|
+ params={{orgId: 'orgId', projectId: 'projectId', groupId: '1'}}
|
|
|
+ group={group}
|
|
|
+ location={{query: {environment: ['prod', 'staging']}}}
|
|
|
+ />
|
|
|
+ </RouteContext.Provider>,
|
|
|
{context: routerContext, organization}
|
|
|
);
|
|
|
|