Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resources/js/components/Product/QuantitySelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default {
decreasable() {
return this.value - this.step >= this.min
},

value: {
get() {
return this.modelValue
Expand Down
8 changes: 2 additions & 6 deletions resources/views/components/quantity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<button
v-on:click.prevent="qtySelect.decrease"
v-bind:disabled="!qtySelect.decreasable"
disabled
aria-label="@lang('Decrease')"
class="shrink-0 pl-2.5 text disabled:cursor-not-allowed disabled:opacity-50"
>
Expand All @@ -17,15 +18,10 @@ class="shrink-0 pl-2.5 text disabled:cursor-not-allowed disabled:opacity-50"
name="qty"
type="number"
data-testid="qty"
value="1"
class="outline-0 ring-0 border-none w-12 bg-transparent font-medium text-center px-0 sm:text-base focus:ring-transparent arrows-hidden"
aria-label="@lang('Quantity')"
ref="input"
:min="qtySelect.min"
:max="qtySelect.max > 0 ? qtySelect.max : null"
:step="qtySelect.step"
v-model="qtySelect.value"
{{ $attributes }}
v-bind="$attrs"
/>
<button
v-on:click.prevent="qtySelect.increase"
Expand Down
1 change: 1 addition & 0 deletions tests/playwright/cart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test('change quantity', BasePage.tags, async ({ page }) => {
const product = await new ProductPage(page).addToCart(process.env.PRODUCT_URL_SIMPLE)
// TODO: Extract to CartPage?
await page.goto('/cart')
await page.waitForLoadState('networkidle')
await page.getByTestId('qty').fill('5')
await page.getByTestId('qty').press('Tab')
await expect(page.getByTestId('cart-item')).toContainText((product.price * 5).toString())
Expand Down
Loading