-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(issues): Don't show break if people section doesn't exist (#79701)
this pr updates the sidebar so that it doesn't show a break if the people section isn't there
- Loading branch information
1 parent
528ce0d
commit 8a4dfe6
Showing
3 changed files
with
65 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import {GroupFixture} from 'sentry-fixture/group'; | ||
import {TeamFixture} from 'sentry-fixture/team'; | ||
import {UserFixture} from 'sentry-fixture/user'; | ||
|
||
|
@@ -8,45 +7,38 @@ import type {TeamParticipant, UserParticipant} from 'sentry/types/group'; | |
import PeopleSection from 'sentry/views/issueDetails/streamline/peopleSection'; | ||
|
||
describe('PeopleSection', () => { | ||
const group = GroupFixture(); | ||
const teams: TeamParticipant[] = [{...TeamFixture(), type: 'team'}]; | ||
const users: UserParticipant[] = [ | ||
{ | ||
...UserFixture({ | ||
id: '2', | ||
name: 'John Smith', | ||
email: '[email protected]', | ||
}), | ||
type: 'user', | ||
}, | ||
{ | ||
...UserFixture({ | ||
id: '3', | ||
name: 'Sohn Jmith', | ||
email: '[email protected]', | ||
}), | ||
type: 'user', | ||
}, | ||
]; | ||
|
||
it('displays participants and viewers', async () => { | ||
const teams: TeamParticipant[] = [{...TeamFixture(), type: 'team'}]; | ||
const users: UserParticipant[] = [ | ||
{ | ||
...UserFixture({ | ||
id: '2', | ||
name: 'John Smith', | ||
email: '[email protected]', | ||
}), | ||
type: 'user', | ||
}, | ||
{ | ||
...UserFixture({ | ||
id: '3', | ||
name: 'Sohn Jmith', | ||
email: '[email protected]', | ||
}), | ||
type: 'user', | ||
}, | ||
]; | ||
|
||
const participantGroup = { | ||
...group, | ||
participants: [...teams, ...users], | ||
seenBy: users, | ||
}; | ||
|
||
render(<PeopleSection group={participantGroup} />); | ||
render( | ||
<PeopleSection teamParticipants={teams} userParticipants={users} viewers={users} /> | ||
); | ||
|
||
expect(await screen.findByText('participating')).toBeInTheDocument(); | ||
expect(await screen.findByText('viewed')).toBeInTheDocument(); | ||
}); | ||
|
||
it('does not display anything if there are no participants or viewers', () => { | ||
render(<PeopleSection group={group} />); | ||
it('does not display particiapnts if there are none', () => { | ||
render(<PeopleSection teamParticipants={[]} userParticipants={[]} viewers={users} />); | ||
|
||
expect(screen.queryByText('participating')).not.toBeInTheDocument(); | ||
expect(screen.queryByText('viewed')).not.toBeInTheDocument(); | ||
}); | ||
}); |
35 changes: 12 additions & 23 deletions
35
static/app/views/issueDetails/streamline/peopleSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters