mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 17:14:28 -04:00
Profile settings: Updating client details
This commit is contained in:
parent
6e5a085787
commit
1c3136e915
@ -2,17 +2,23 @@
|
||||
|
||||
namespace Tests\Browser\ClientPortal;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Faker\Factory;
|
||||
use Faker\Generator;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\Browser\Pages\ClientPortal\Login;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
class ProfileSettingsTest extends DuskTestCase
|
||||
{
|
||||
/** @var Generator */
|
||||
public $faker;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->faker = Factory::create();
|
||||
|
||||
foreach (static::$browsers as $browser) {
|
||||
$browser->driver->manage()->deleteAllCookies();
|
||||
}
|
||||
@ -36,4 +42,39 @@ class ProfileSettingsTest extends DuskTestCase
|
||||
->visitRoute('client.logout');
|
||||
});
|
||||
}
|
||||
|
||||
public function testClientDetailsUpdate()
|
||||
{
|
||||
$original = [
|
||||
'name' => $this->faker->name,
|
||||
'vat_number' => $this->faker->randomNumber(6),
|
||||
'phone' => $this->faker->phoneNumber,
|
||||
'website' => $this->faker->url,
|
||||
];
|
||||
|
||||
$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
|
||||
->type('name', $original['name'])
|
||||
->type('vat_number', $original['vat_number'])
|
||||
->type('phone', $original['phone'])
|
||||
->type('website', $original['website'])
|
||||
->press('Save')
|
||||
->refresh();
|
||||
|
||||
$updated = [
|
||||
'name' => $browser->inputValue('name'),
|
||||
'vat_number' => $browser->inputValue('vat_number'),
|
||||
'phone' => $browser->inputValue('phone'),
|
||||
'website' => $browser->inputValue('website')
|
||||
];
|
||||
|
||||
$this->assertNotSame($original, $updated);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user