test_organization_activity.py 1.4 KB

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