mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 06:32:40 +01:00
Profile settings: Updating shipping address
This commit is contained in:
parent
a716330bcb
commit
1af12ea585
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||
<form wire:submit.prevent="submit" method="POST" id="update_contact">
|
||||
<form wire:submit.prevent="submit" method="POST" id="update_shipping_address">
|
||||
@csrf
|
||||
<div class="shadow overflow-hidden rounded">
|
||||
<div class="px-4 py-5 bg-white sm:p-6">
|
||||
|
@ -164,4 +164,47 @@ class ProfileSettingsTest extends DuskTestCase
|
||||
$this->assertSame($original, $updated);
|
||||
});
|
||||
}
|
||||
|
||||
public function testShippingAddressUpdate()
|
||||
{
|
||||
$original = [
|
||||
'street' => $this->faker->streetName,
|
||||
'apt' => $this->faker->streetAddress,
|
||||
'city' => $this->faker->city,
|
||||
'state' => $this->faker->state,
|
||||
'postal_code' => $this->faker->postcode,
|
||||
];
|
||||
|
||||
$this->browse(function (Browser $browser) use ($original) {
|
||||
$browser
|
||||
->visitRoute('client.invoices.index')
|
||||
->click('button[data-ref="client-profile-dropdown"]')
|
||||
->click('a[data-ref="client-profile-dropdown-settings"]')
|
||||
->waitForText('Client Information');
|
||||
|
||||
$browser
|
||||
->with('#update_shipping_address', function (Browser $form) use ($original) {
|
||||
$form
|
||||
->type('#shipping_address1', $original['street'])
|
||||
->type('#shipping_address2', $original['apt'])
|
||||
->type('#shipping_city', $original['city'])
|
||||
->type('#shipping_state', $original['state'])
|
||||
->type('#shipping_postal_code', $original['postal_code'])
|
||||
->select('#shipping_country')
|
||||
->press('Save');
|
||||
})
|
||||
->pause(1000)
|
||||
->refresh();
|
||||
|
||||
$updated = [
|
||||
'street' => $browser->value('#shipping_address1'),
|
||||
'apt' => $browser->value('#shipping_address2'),
|
||||
'city' => $browser->value('#shipping_city'),
|
||||
'state' => $browser->value('#shipping_state'),
|
||||
'postal_code' => $browser->value('#shipping_postal_code'),
|
||||
];
|
||||
|
||||
$this->assertSame($original, $updated);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user