groupActivity.spec.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. import {GroupFixture} from 'sentry-fixture/group';
  2. import {OrganizationFixture} from 'sentry-fixture/organization';
  3. import {ProjectFixture} from 'sentry-fixture/project';
  4. import {ReleaseFixture} from 'sentry-fixture/release';
  5. import {RepositoryFixture} from 'sentry-fixture/repository';
  6. import {TeamFixture} from 'sentry-fixture/team';
  7. import {UserFixture} from 'sentry-fixture/user';
  8. import {initializeOrg} from 'sentry-test/initializeOrg';
  9. import {
  10. act,
  11. render,
  12. renderGlobalModal,
  13. screen,
  14. userEvent,
  15. waitFor,
  16. } from 'sentry-test/reactTestingLibrary';
  17. import ConfigStore from 'sentry/stores/configStore';
  18. import GroupStore from 'sentry/stores/groupStore';
  19. import OrganizationStore from 'sentry/stores/organizationStore';
  20. import ProjectsStore from 'sentry/stores/projectsStore';
  21. import TeamStore from 'sentry/stores/teamStore';
  22. import {
  23. Group,
  24. GroupActivityType,
  25. Organization as TOrganization,
  26. PriorityLevel,
  27. Project,
  28. } from 'sentry/types';
  29. import useOrganization from 'sentry/utils/useOrganization';
  30. import GroupActivity from 'sentry/views/issueDetails/groupActivity';
  31. jest.mock('sentry/utils/useOrganization');
  32. describe('GroupActivity', function () {
  33. let project!: Project;
  34. const dateCreated = '2021-10-01T15:31:38.950115Z';
  35. beforeEach(function () {
  36. project = ProjectFixture();
  37. ProjectsStore.loadInitialData([project]);
  38. ConfigStore.init();
  39. ConfigStore.set('user', UserFixture({id: '123'}));
  40. GroupStore.init();
  41. });
  42. afterEach(() => {
  43. MockApiClient.clearMockResponses();
  44. jest.clearAllMocks();
  45. });
  46. function createWrapper({
  47. activity,
  48. organization: additionalOrg,
  49. }: {
  50. activity?: Group['activity'];
  51. organization?: TOrganization;
  52. } = {}) {
  53. const group = GroupFixture({
  54. id: '1337',
  55. activity: activity ?? [
  56. {
  57. type: GroupActivityType.NOTE,
  58. id: 'note-1',
  59. data: {text: 'Test Note'},
  60. dateCreated: '2020-01-01T00:00:00',
  61. user: UserFixture(),
  62. project,
  63. },
  64. ],
  65. project,
  66. });
  67. const {organization, routerContext, routerProps} = initializeOrg({
  68. organization: additionalOrg,
  69. });
  70. jest.mocked(useOrganization).mockReturnValue(organization);
  71. GroupStore.add([group]);
  72. TeamStore.loadInitialData([TeamFixture({id: '999', slug: 'no-team'})]);
  73. OrganizationStore.onUpdate(organization, {replace: true});
  74. return render(
  75. <GroupActivity {...routerProps} params={{orgId: 'org-slug'}} group={group} />,
  76. {context: routerContext}
  77. );
  78. }
  79. it('renders a NoteInput', function () {
  80. createWrapper();
  81. expect(screen.getByTestId('activity-note-body')).toBeInTheDocument();
  82. });
  83. it('renders a marked reviewed activity', function () {
  84. const user = UserFixture({name: 'Samwise'});
  85. createWrapper({
  86. activity: [
  87. {
  88. type: GroupActivityType.MARK_REVIEWED,
  89. id: 'reviewed-1',
  90. dateCreated: '',
  91. project: ProjectFixture(),
  92. data: {},
  93. user,
  94. },
  95. ],
  96. });
  97. expect(screen.getByText('marked this issue as reviewed')).toBeInTheDocument();
  98. expect(screen.getByText(user.name)).toBeInTheDocument();
  99. });
  100. it('renders a pr activity', function () {
  101. const user = UserFixture({name: 'Test User'});
  102. const repository = RepositoryFixture();
  103. createWrapper({
  104. activity: [
  105. {
  106. dateCreated: '',
  107. project: ProjectFixture(),
  108. type: GroupActivityType.SET_RESOLVED_IN_PULL_REQUEST,
  109. id: 'pr-1',
  110. data: {
  111. pullRequest: {
  112. externalUrl: '',
  113. id: '',
  114. title: '',
  115. repository,
  116. },
  117. },
  118. user,
  119. },
  120. ],
  121. });
  122. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  123. 'Test User has created a PR for this issue:'
  124. );
  125. });
  126. it('renders a assigned to self activity', function () {
  127. const user = UserFixture({id: '123', name: 'Mark'});
  128. createWrapper({
  129. activity: [
  130. {
  131. data: {
  132. assignee: user.id,
  133. assigneeEmail: user.email,
  134. assigneeType: 'user',
  135. user,
  136. },
  137. user,
  138. dateCreated: '2021-10-01T15:31:38.950115Z',
  139. id: '117',
  140. project: ProjectFixture(),
  141. type: GroupActivityType.ASSIGNED,
  142. },
  143. ],
  144. });
  145. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  146. /Mark assigned this issue to themselves/
  147. );
  148. });
  149. it('renders an assigned via codeowners activity', function () {
  150. createWrapper({
  151. activity: [
  152. {
  153. data: {
  154. assignee: '123',
  155. assigneeEmail: 'anotheruser@sentry.io',
  156. assigneeType: 'user',
  157. integration: 'codeowners',
  158. rule: 'path:something/*.py #workflow',
  159. user: UserFixture(),
  160. },
  161. project: ProjectFixture(),
  162. dateCreated: '2021-10-01T15:31:38.950115Z',
  163. id: '117',
  164. type: GroupActivityType.ASSIGNED,
  165. user: null,
  166. },
  167. ],
  168. });
  169. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  170. /Sentry auto-assigned this issue to anotheruser@sentry.io/
  171. );
  172. });
  173. it('renders an assigned via slack activity', function () {
  174. const user = UserFixture({id: '301', name: 'Mark'});
  175. createWrapper({
  176. activity: [
  177. {
  178. data: {
  179. assignee: '123',
  180. assigneeEmail: 'anotheruser@sentry.io',
  181. assigneeType: 'user',
  182. integration: 'slack',
  183. user: UserFixture(),
  184. },
  185. project: ProjectFixture(),
  186. dateCreated: '2021-10-01T15:31:38.950115Z',
  187. id: '117',
  188. type: GroupActivityType.ASSIGNED,
  189. user,
  190. },
  191. ],
  192. });
  193. const item = screen.getAllByTestId('activity-item').at(-1);
  194. expect(item).toHaveTextContent(/Mark assigned this issue to anotheruser@sentry.io/);
  195. expect(item).toHaveTextContent(/Assigned via Slack/);
  196. });
  197. it('resolved in commit with no releases', function () {
  198. createWrapper({
  199. activity: [
  200. {
  201. type: GroupActivityType.SET_RESOLVED_IN_COMMIT,
  202. id: '123',
  203. project: ProjectFixture(),
  204. dateCreated: '',
  205. data: {
  206. commit: {
  207. dateCreated: '',
  208. message: '',
  209. id: 'komal-commit',
  210. repository: RepositoryFixture(),
  211. releases: [],
  212. },
  213. },
  214. user: UserFixture(),
  215. },
  216. ],
  217. });
  218. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  219. 'Foo Bar marked this issue as resolved in komal-commit'
  220. );
  221. });
  222. it('resolved in commit with one release', function () {
  223. createWrapper({
  224. activity: [
  225. {
  226. type: GroupActivityType.SET_RESOLVED_IN_COMMIT,
  227. id: '123',
  228. project: ProjectFixture(),
  229. dateCreated: '',
  230. data: {
  231. commit: {
  232. id: 'komal-commit',
  233. dateCreated: '',
  234. message: '',
  235. repository: RepositoryFixture(),
  236. releases: [
  237. ReleaseFixture({
  238. dateCreated: '2022-05-01',
  239. dateReleased: '2022-05-02',
  240. version: 'random',
  241. }),
  242. ],
  243. },
  244. },
  245. user: UserFixture(),
  246. },
  247. ],
  248. });
  249. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  250. 'Foo Bar marked this issue as resolved in komal-commit This commit was released in random'
  251. );
  252. });
  253. it('resolved in commit with multiple releases', function () {
  254. createWrapper({
  255. activity: [
  256. {
  257. type: GroupActivityType.SET_RESOLVED_IN_COMMIT,
  258. id: '123',
  259. project: ProjectFixture(),
  260. dateCreated: '',
  261. data: {
  262. commit: {
  263. id: 'komal-commit',
  264. dateCreated: '',
  265. message: '',
  266. repository: RepositoryFixture(),
  267. releases: [
  268. ReleaseFixture({
  269. dateCreated: '2022-05-01',
  270. dateReleased: '2022-05-02',
  271. version: 'random',
  272. }),
  273. ReleaseFixture({
  274. dateCreated: '2022-06-01',
  275. dateReleased: '2022-06-02',
  276. version: 'newest',
  277. }),
  278. ReleaseFixture({
  279. dateCreated: '2021-08-03',
  280. dateReleased: '2021-08-03',
  281. version: 'oldest-release',
  282. }),
  283. ReleaseFixture({
  284. dateCreated: '2022-04-21',
  285. dateReleased: '2022-04-21',
  286. version: 'randomTwo',
  287. }),
  288. ],
  289. },
  290. },
  291. user: UserFixture(),
  292. },
  293. ],
  294. });
  295. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  296. 'Foo Bar marked this issue as resolved in komal-commit This commit was released in oldest-release and 3 others'
  297. );
  298. });
  299. it('requests assignees that are not in the team store', async function () {
  300. const team = TeamFixture({id: '123', name: 'workflow'});
  301. const teamRequest = MockApiClient.addMockResponse({
  302. url: `/organizations/org-slug/teams/`,
  303. body: [team],
  304. });
  305. createWrapper({
  306. activity: [
  307. {
  308. id: '123',
  309. user: null,
  310. type: GroupActivityType.ASSIGNED,
  311. project: ProjectFixture(),
  312. data: {
  313. assignee: team.id,
  314. assigneeType: 'team',
  315. user: UserFixture(),
  316. },
  317. dateCreated: '2021-10-28T13:40:10.634821Z',
  318. },
  319. ],
  320. });
  321. await waitFor(() => expect(teamRequest).toHaveBeenCalledTimes(1));
  322. expect(
  323. await screen.findByText(`assigned this issue to #${team.slug}`)
  324. ).toBeInTheDocument();
  325. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  326. /Sentry assigned this issue to #team-slug/
  327. );
  328. });
  329. describe('Delete', function () {
  330. let deleteMock;
  331. beforeEach(function () {
  332. deleteMock = MockApiClient.addMockResponse({
  333. url: '/organizations/org-slug/issues/1337/comments/note-1/',
  334. method: 'DELETE',
  335. });
  336. ConfigStore.set('user', UserFixture({id: '123', isSuperuser: true}));
  337. });
  338. it('should do nothing if not present in GroupStore', async function () {
  339. createWrapper();
  340. renderGlobalModal();
  341. act(() => {
  342. // Remove note from group activity
  343. GroupStore.removeActivity('1337', 'note-1');
  344. });
  345. await userEvent.click(screen.getByRole('button', {name: 'Comment Actions'}));
  346. await userEvent.click(screen.getByRole('menuitemradio', {name: 'Remove'}));
  347. expect(
  348. screen.getByText('Are you sure you wish to delete this comment?')
  349. ).toBeInTheDocument();
  350. await userEvent.click(screen.getByRole('button', {name: 'Confirm'}));
  351. expect(deleteMock).not.toHaveBeenCalled();
  352. });
  353. it('should remove remove the item from the GroupStore make a DELETE API request', async function () {
  354. createWrapper();
  355. renderGlobalModal();
  356. await userEvent.click(screen.getByRole('button', {name: 'Comment Actions'}));
  357. await userEvent.click(screen.getByRole('menuitemradio', {name: 'Remove'}));
  358. expect(
  359. screen.getByText('Are you sure you wish to delete this comment?')
  360. ).toBeInTheDocument();
  361. await userEvent.click(screen.getByRole('button', {name: 'Confirm'}));
  362. expect(deleteMock).toHaveBeenCalledTimes(1);
  363. });
  364. });
  365. it('renders archived until escalating', function () {
  366. createWrapper({
  367. activity: [
  368. {
  369. id: '123',
  370. type: GroupActivityType.SET_IGNORED,
  371. project: ProjectFixture(),
  372. data: {
  373. ignoreUntilEscalating: true,
  374. },
  375. user: UserFixture(),
  376. dateCreated,
  377. },
  378. ],
  379. organization: OrganizationFixture({}),
  380. });
  381. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  382. 'Foo Bar archived this issue until it escalates'
  383. );
  384. });
  385. it('renders escalating with forecast and plural events', function () {
  386. createWrapper({
  387. activity: [
  388. {
  389. id: '123',
  390. type: GroupActivityType.SET_UNRESOLVED,
  391. project: ProjectFixture(),
  392. data: {
  393. forecast: 200,
  394. },
  395. user: null,
  396. dateCreated,
  397. },
  398. {
  399. id: '124',
  400. type: GroupActivityType.SET_ESCALATING,
  401. project: ProjectFixture(),
  402. data: {
  403. forecast: 400,
  404. },
  405. user: null,
  406. dateCreated: '2021-10-05T15:31:38.950115Z',
  407. },
  408. ],
  409. organization: OrganizationFixture({}),
  410. });
  411. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  412. 'Sentry flagged this issue as escalating because over 400 events happened in an hour'
  413. );
  414. expect(screen.getAllByTestId('activity-item').at(-2)).toHaveTextContent(
  415. 'Sentry flagged this issue as escalating because over 200 events happened in an hour'
  416. );
  417. });
  418. it('renders escalating with forecast and singular event', function () {
  419. createWrapper({
  420. activity: [
  421. {
  422. id: '123',
  423. type: GroupActivityType.SET_UNRESOLVED,
  424. project: ProjectFixture(),
  425. data: {
  426. forecast: 1,
  427. },
  428. user: null,
  429. dateCreated,
  430. },
  431. ],
  432. organization: OrganizationFixture({}),
  433. });
  434. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  435. 'Sentry flagged this issue as escalating because over 1 event happened in an hour'
  436. );
  437. });
  438. it('renders issue unresvoled via jira', function () {
  439. createWrapper({
  440. activity: [
  441. {
  442. id: '123',
  443. type: GroupActivityType.SET_UNRESOLVED,
  444. project: ProjectFixture(),
  445. data: {
  446. integration_id: '1',
  447. provider_key: 'jira',
  448. provider: 'Jira',
  449. },
  450. user: null,
  451. dateCreated,
  452. },
  453. ],
  454. });
  455. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  456. 'Sentry marked this issue as unresolved via Jira'
  457. );
  458. });
  459. it('renders issue resolved via jira', function () {
  460. createWrapper({
  461. activity: [
  462. {
  463. id: '123',
  464. type: GroupActivityType.SET_RESOLVED,
  465. project: ProjectFixture(),
  466. data: {
  467. integration_id: '1',
  468. provider_key: 'jira',
  469. provider: 'Jira',
  470. },
  471. user: null,
  472. dateCreated,
  473. },
  474. ],
  475. });
  476. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  477. 'Sentry marked this issue as resolved via Jira'
  478. );
  479. });
  480. it('renders escalating since it happened x times in time window', function () {
  481. createWrapper({
  482. activity: [
  483. {
  484. id: '123',
  485. type: GroupActivityType.SET_ESCALATING,
  486. project: ProjectFixture(),
  487. data: {
  488. expired_snooze: {
  489. count: 400,
  490. window: 1,
  491. until: null,
  492. user_count: null,
  493. user_window: null,
  494. },
  495. },
  496. dateCreated,
  497. },
  498. ],
  499. });
  500. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  501. 'Sentry flagged this issue as escalating because 400 events happened in 1 minute'
  502. );
  503. });
  504. it('renders escalating since x users were affected in time window', function () {
  505. createWrapper({
  506. activity: [
  507. {
  508. id: '123',
  509. type: GroupActivityType.SET_ESCALATING,
  510. project: ProjectFixture(),
  511. data: {
  512. expired_snooze: {
  513. user_count: 1,
  514. user_window: 1,
  515. until: null,
  516. count: null,
  517. window: null,
  518. },
  519. },
  520. dateCreated,
  521. },
  522. ],
  523. });
  524. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  525. 'Sentry flagged this issue as escalating because 1 user was affected in 1 minute'
  526. );
  527. });
  528. it('renders escalating since until date passed', function () {
  529. const date = new Date('2018-10-30');
  530. createWrapper({
  531. activity: [
  532. {
  533. id: '123',
  534. type: GroupActivityType.SET_ESCALATING,
  535. project: ProjectFixture(),
  536. data: {
  537. expired_snooze: {
  538. until: date,
  539. user_count: null,
  540. user_window: null,
  541. count: null,
  542. window: null,
  543. },
  544. },
  545. dateCreated,
  546. },
  547. ],
  548. });
  549. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  550. 'Sentry flagged this issue as escalating because Oct 30, 2018 12:00 AM passed'
  551. );
  552. });
  553. it('renders archived forever', function () {
  554. createWrapper({
  555. activity: [
  556. {
  557. id: '123',
  558. type: GroupActivityType.SET_IGNORED,
  559. project: ProjectFixture(),
  560. data: {},
  561. user: UserFixture(),
  562. dateCreated,
  563. },
  564. ],
  565. organization: OrganizationFixture({}),
  566. });
  567. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  568. 'Foo Bar archived this issue forever'
  569. );
  570. });
  571. it('renders resolved in release with semver information', function () {
  572. createWrapper({
  573. activity: [
  574. {
  575. id: '123',
  576. type: GroupActivityType.SET_RESOLVED_IN_RELEASE,
  577. project: ProjectFixture(),
  578. data: {
  579. version: 'frontend@1.0.0',
  580. },
  581. user: UserFixture(),
  582. dateCreated,
  583. },
  584. ],
  585. });
  586. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  587. 'Foo Bar marked this issue as resolved in 1.0.0 (semver)'
  588. );
  589. });
  590. it('renders resolved in next release with semver information', function () {
  591. createWrapper({
  592. activity: [
  593. {
  594. id: '123',
  595. type: GroupActivityType.SET_RESOLVED_IN_RELEASE,
  596. project: ProjectFixture(),
  597. data: {
  598. current_release_version: 'frontend@1.0.0',
  599. },
  600. user: UserFixture(),
  601. dateCreated,
  602. },
  603. ],
  604. });
  605. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  606. 'Foo Bar marked this issue as resolved in releases greater than 1.0.0 (semver)'
  607. );
  608. });
  609. describe('regression', function () {
  610. it('renders basic regression', function () {
  611. createWrapper({
  612. activity: [
  613. {
  614. id: '123',
  615. type: GroupActivityType.SET_REGRESSION,
  616. project: ProjectFixture(),
  617. data: {},
  618. dateCreated,
  619. },
  620. ],
  621. });
  622. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  623. 'Sentry marked this issue as a regression'
  624. );
  625. });
  626. it('renders regression with version', function () {
  627. createWrapper({
  628. activity: [
  629. {
  630. id: '123',
  631. type: GroupActivityType.SET_REGRESSION,
  632. project: ProjectFixture(),
  633. data: {
  634. version: 'frontend@1.0.0',
  635. },
  636. dateCreated,
  637. },
  638. ],
  639. });
  640. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  641. 'Sentry marked this issue as a regression in 1.0.0'
  642. );
  643. });
  644. it('renders regression with semver description', function () {
  645. createWrapper({
  646. activity: [
  647. {
  648. id: '123',
  649. type: GroupActivityType.SET_REGRESSION,
  650. project: ProjectFixture(),
  651. data: {
  652. version: 'frontend@2.0.0',
  653. resolved_in_version: 'frontend@1.0.0',
  654. follows_semver: true,
  655. },
  656. dateCreated,
  657. },
  658. ],
  659. });
  660. const activity = screen.getAllByTestId('activity-item').at(-1);
  661. expect(activity).toHaveTextContent(
  662. 'Sentry marked this issue as a regression in 2.0.0'
  663. );
  664. expect(activity).toHaveTextContent(
  665. '2.0.0 is greater than or equal to 1.0.0 compared via semver'
  666. );
  667. });
  668. it('renders regression with non-semver description', function () {
  669. createWrapper({
  670. activity: [
  671. {
  672. id: '123',
  673. type: GroupActivityType.SET_REGRESSION,
  674. project: ProjectFixture(),
  675. data: {
  676. version: 'frontend@abc1',
  677. resolved_in_version: 'frontend@abc2',
  678. follows_semver: false,
  679. },
  680. dateCreated,
  681. },
  682. ],
  683. });
  684. const activity = screen.getAllByTestId('activity-item').at(-1);
  685. expect(activity).toHaveTextContent(
  686. 'Sentry marked this issue as a regression in abc1'
  687. );
  688. expect(activity).toHaveTextContent(
  689. 'abc1 is greater than or equal to abc2 compared via release date'
  690. );
  691. });
  692. it('renders a set priority activity for escalating issues', function () {
  693. createWrapper({
  694. activity: [
  695. {
  696. id: '123',
  697. type: GroupActivityType.SET_PRIORITY,
  698. project: ProjectFixture(),
  699. data: {
  700. priority: PriorityLevel.HIGH,
  701. reason: 'escalating',
  702. },
  703. dateCreated,
  704. },
  705. ],
  706. });
  707. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  708. 'Sentry updated the priority value of this issue to be high after it escalated'
  709. );
  710. });
  711. it('renders a set priority activity for ongoing issues', function () {
  712. createWrapper({
  713. activity: [
  714. {
  715. id: '123',
  716. type: GroupActivityType.SET_PRIORITY,
  717. project: ProjectFixture(),
  718. data: {
  719. priority: PriorityLevel.LOW,
  720. reason: 'ongoing',
  721. },
  722. dateCreated,
  723. },
  724. ],
  725. });
  726. expect(screen.getAllByTestId('activity-item').at(-1)).toHaveTextContent(
  727. 'Sentry updated the priority value of this issue to be low after it was marked as ongoing'
  728. );
  729. });
  730. });
  731. });