delete option staff varizi
This commit is contained in:
1 parent
d99e47ecce
commit
b53a3e0c5c
14 files changed
+383
-3
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import pytest
|
||||
from django.urls import reverse
|
||||
from playwright.sync_api import expect
|
||||
|
||||
from apps.payments import services
|
||||
from tests.e2e.pages.auth import AuthenticationPage
|
||||
from tests.e2e.pages.notice_deletion import NoticeDeletionPage
|
||||
from tests.e2e.test_payments_e2e import payment_case, PASSWORD
|
||||
|
||||
pytestmark = [pytest.mark.e2e, pytest.mark.django_db(transaction=True)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize('width', [320, 1440])
|
||||
def test_notice_delete_requires_review_and_confirmation(live_server, browser_page, payment_case, width):
|
||||
customer, account, reviewers = payment_case
|
||||
notice = services.issue_notice(reviewers[0], {'customer': customer, 'account': account,
|
||||
'subject': 'اعلامیه قابل حذف', 'amount': 12345})
|
||||
path = reverse('staff_payments:notice_detail', args=[notice.public_id])
|
||||
with browser_page() as page:
|
||||
page.set_viewport_size({'width': width, 'height': 900})
|
||||
AuthenticationPage(page, live_server.url).login_staff(reviewers[0], PASSWORD)
|
||||
view = NoticeDeletionPage(page, live_server.url)
|
||||
view.open_notice(path)
|
||||
view.review_and_cancel()
|
||||
expect(page.get_by_text('اعلامیه قابل حذف', exact=True)).to_be_visible()
|
||||
view.confirm_deletion()
|
||||
expect(page.get_by_role('link', name='مشاهده اعلامیه', exact=False)).to_have_count(0)
|
||||
assert page.evaluate('document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1')
|
||||
Reference in new issue
Block a user