test_organization_activity.py 1.4 KB

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