feat(админка): ручной взнос v2 с идемпотентностью
This commit is contained in:
@@ -242,3 +242,20 @@ def test_delete_from_drawer_and_undo(browser, site):
|
||||
paths = [a["path"] for a in Handler.actions]
|
||||
assert any("/delete" in p for p in paths) and any("/restore" in p for p in paths)
|
||||
page.close()
|
||||
|
||||
|
||||
def test_topup_from_drawer(browser, site):
|
||||
Handler.actions = []; Handler.blocked = False; Handler.fail_action = None; Handler.fail_card = False
|
||||
page = browser.new_page()
|
||||
page.add_init_script("localStorage.setItem('token','t')")
|
||||
page.goto(site + "/admin/v2/customers")
|
||||
page.locator("tr.clickable").first.click()
|
||||
page.wait_for_selector(".drawer .kv")
|
||||
page.on("dialog", lambda d: d.accept("500"))
|
||||
page.locator(".actions-bar button", has_text="Внести").click()
|
||||
page.wait_for_selector(".toast")
|
||||
assert "Взнос записан" in page.locator(".toast").inner_text()
|
||||
assert any("/customers/anna%40x/topup" in a["path"] for a in Handler.actions)
|
||||
sent = next(a["body"] for a in Handler.actions if "/topup" in a["path"])
|
||||
assert '"amount":"500"' in sent
|
||||
page.close()
|
||||
|
||||
Reference in New Issue
Block a user