groupActivity.spec.tsx 22 KB

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