test_organization_activity.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from django.utils import timezone
  2. from sentry.models import Activity
  3. from sentry.testutils.cases import AcceptanceTestCase
  4. from sentry.testutils.silo import no_silo_test
  5. from sentry.types.activity import ActivityType
  6. @no_silo_test(stable=True)
  7. class OrganizationActivityTest(AcceptanceTestCase):
  8. def setUp(self):
  9. super().setUp()
  10. self.org = self.create_organization(owner=self.user, name="Rowdy Tiger")
  11. self.team = self.create_team(
  12. organization=self.org, name="Mariachi Band", members=[self.user]
  13. )
  14. self.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal")
  15. self.group = self.create_group(project=self.project)
  16. self.login_as(self.user)
  17. self.path = f"/organizations/{self.org.slug}/activity/"
  18. self.project.update(first_event=timezone.now())
  19. def test(self):
  20. Activity.objects.create(
  21. group=self.group,
  22. project=self.group.project,
  23. type=ActivityType.NOTE.value,
  24. user_id=self.user.id,
  25. data={"text": "hello world"},
  26. )
  27. self.browser.get(self.path)
  28. self.browser.wait_until_not(".loading-indicator", timeout=100000)
  29. self.browser.wait_until('[data-test-id="activity-feed-list"]')
  30. self.browser.snapshot("organization activity feed")
  31. def test_empty(self):
  32. self.browser.get(self.path)
  33. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  34. self.browser.snapshot("organization activity feed - empty")