Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ describe('useReplaysFromIssue', () => {
},
};

const location = LocationFixture();

const organization = OrganizationFixture({
features: ['session-replay'],
});

it.isKnownFlake('should fetch a list of replay ids', async () => {
it('should fetch a list of replay ids', async () => {
const location = LocationFixture();
const organization = OrganizationFixture({
features: ['session-replay'],
});
const MOCK_GROUP = GroupFixture();

MockApiClient.addMockResponse({
Expand All @@ -41,19 +39,21 @@ describe('useReplaysFromIssue', () => {
initialRouterConfig,
});

await waitFor(() =>
expect(result.current).toEqual({
eventView: expect.objectContaining({
query: 'id:[replay42,replay256]',
}),
fetchError: undefined,
isFetching: false,
pageLinks: null,
await waitFor(() => expect(result.current.isFetching).toBe(false));

expect(result.current.eventView).toEqual(
expect.objectContaining({
query: 'id:[replay42,replay256]',
})
);
expect(result.current.fetchError).toBeUndefined();
});

it('should fetch a list of replay ids for a performance issue', async () => {
const location = LocationFixture();
const organization = OrganizationFixture({
features: ['session-replay'],
});
const MOCK_GROUP = GroupFixture({issueCategory: IssueCategory.PERFORMANCE});

MockApiClient.addMockResponse({
Expand All @@ -73,19 +73,21 @@ describe('useReplaysFromIssue', () => {
initialRouterConfig,
});

await waitFor(() =>
expect(result.current).toEqual({
eventView: expect.objectContaining({
query: 'id:[replay42,replay256]',
}),
fetchError: undefined,
isFetching: false,
pageLinks: null,
await waitFor(() => expect(result.current.isFetching).toBe(false));

expect(result.current.eventView).toEqual(
expect.objectContaining({
query: 'id:[replay42,replay256]',
})
);
expect(result.current.fetchError).toBeUndefined();
});

it('should return an empty EventView when there are no replay_ids returned from the count endpoint', async () => {
const location = LocationFixture();
const organization = OrganizationFixture({
features: ['session-replay'],
});
const MOCK_GROUP = GroupFixture();

MockApiClient.addMockResponse({
Expand All @@ -103,13 +105,9 @@ describe('useReplaysFromIssue', () => {
initialRouterConfig,
});

await waitFor(() =>
expect(result.current).toEqual({
eventView: null,
fetchError: undefined,
isFetching: false,
pageLinks: null,
})
);
await waitFor(() => expect(result.current.isFetching).toBe(false));

expect(result.current.eventView).toBeNull();
expect(result.current.fetchError).toBeUndefined();
});
});
Loading