Change a quick sale order before making starts
An unpaid order whose lines have no completed step can be reopened in the cart from the open orders list; saving replaces its lines with current prices and processes, moves the machine work list rows and keeps the pickup number. Keyboard browser tests cover changing and cancelling an order and moving production steps. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -72,3 +72,45 @@ it('completes an order on the console and pays it on the quick sale page with th
|
||||
->assertSee('Tilaus 1 maksettu')
|
||||
->assertSee('Avaa kuitti');
|
||||
});
|
||||
|
||||
it('changes an order with the keyboard, moving focus to the cart', function () {
|
||||
visit(route('sales.sell'))
|
||||
->keys('[aria-label="'.__('sales.orders.change_named', ['number' => 1]).'"]', 'Enter')
|
||||
->assertSee(__('sales.orders.editing_notice', ['number' => 1]))
|
||||
->assertScript('document.activeElement.id', 'cart-heading')
|
||||
->assertSee(__('sales.orders.save_change'))
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->keys('#stop-editing', 'Enter')
|
||||
->assertScript('document.activeElement.id', 'cart-heading')
|
||||
->assertDontSee(__('sales.orders.editing_notice', ['number' => 1]))
|
||||
->keys('[aria-label="'.__('sales.orders.change_named', ['number' => 1]).'"]', 'Enter')
|
||||
->keys('#order-customer-name', 'Control+a')
|
||||
->type('#order-customer-name', 'Liisa')
|
||||
->keys('#order-customer-name', 'Enter')
|
||||
->assertSee('Tilaus 1 muutettu')
|
||||
->assertSee('Liisa');
|
||||
});
|
||||
|
||||
it('cancels an order in a dialog that takes and returns focus', function () {
|
||||
$cancel = '[aria-label="'.__('sales.orders.cancel_named', ['number' => 1]).'"]';
|
||||
|
||||
visit(route('sales.sell'))
|
||||
->keys($cancel, 'Enter')
|
||||
->assertScript('document.getElementById("cancel-order-dialog").open', true)
|
||||
->assertScript('document.getElementById("cancel-order-dialog").contains(document.activeElement)', true)
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->keys('#cancel-order-dialog', 'Escape')
|
||||
->assertScript('document.getElementById("cancel-order-dialog").open', false)
|
||||
->assertScript('document.activeElement.getAttribute("aria-label")', __('sales.orders.cancel_named', ['number' => 1]))
|
||||
->keys($cancel, 'Enter')
|
||||
->click('#cancel-order-dialog button[wire\:click="cancel"]')
|
||||
->assertSee('Tilaus 1 peruttu.')
|
||||
->assertScript('document.activeElement.id', 'orders-status');
|
||||
});
|
||||
|
||||
it('moves a production step with the keyboard, keeping focus', function () {
|
||||
visit(route('catalog.products.edit', $this->sticker->id))
|
||||
->keys('[aria-label="'.__('catalog.workflows.move_up_named', ['number' => 2]).'"]', 'Enter')
|
||||
->assertScript('document.activeElement.getAttribute("aria-label")', __('catalog.workflows.move_up_named', ['number' => 1]))
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user