Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Admin/UserTest.php
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | public function testUserInfo2(): void | ||||
$page = new UserPage($john->id); | $page = new UserPage($john->id); | ||||
$discount = Discount::where('code', 'TEST')->first(); | $discount = Discount::where('code', 'TEST')->first(); | ||||
$wallet = $john->wallet(); | $wallet = $john->wallet(); | ||||
$wallet->discount()->associate($discount); | $wallet->discount()->associate($discount); | ||||
$wallet->debit(2010); | $wallet->debit(2010); | ||||
$wallet->save(); | $wallet->save(); | ||||
$group = $this->getTestGroup('group-test@kolab.org'); | $group = $this->getTestGroup('group-test@kolab.org'); | ||||
$group->assignToWallet($john->wallets->first()); | $group->assignToWallet($john->wallets->first()); | ||||
$john->setSetting('greylisting', null); | $john->setSetting('greylist_enabled', null); | ||||
// Click the managed-by link on Jack's page | // Click the managed-by link on Jack's page | ||||
$browser->click('@user-info #manager a') | $browser->click('@user-info #manager a') | ||||
->on($page); | ->on($page); | ||||
// Assert main info box content | // Assert main info box content | ||||
$browser->assertSeeIn('@user-info .card-title', $john->email) | $browser->assertSeeIn('@user-info .card-title', $john->email) | ||||
->with('@user-info form', function (Browser $browser) use ($john) { | ->with('@user-info form', function (Browser $browser) use ($john) { | ||||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | public function testUserInfo2(): void | ||||
'wallet_id' => $wallet->id, | 'wallet_id' => $wallet->id, | ||||
'sku_id' => $storage_sku->id, | 'sku_id' => $storage_sku->id, | ||||
'cost' => 5000, | 'cost' => 5000, | ||||
'entitleable_id' => $ned->id, | 'entitleable_id' => $ned->id, | ||||
'entitleable_type' => User::class | 'entitleable_type' => User::class | ||||
]); | ]); | ||||
$page = new UserPage($ned->id); | $page = new UserPage($ned->id); | ||||
$ned->setSetting('greylisting', 'false'); | $ned->setSetting('greylist_enabled', 'false'); | ||||
$browser->click('@user-users tbody tr:nth-child(4) td:first-child a') | $browser->click('@user-users tbody tr:nth-child(4) td:first-child a') | ||||
->on($page); | ->on($page); | ||||
// Assert main info box content | // Assert main info box content | ||||
$browser->assertSeeIn('@user-info .card-title', $ned->email) | $browser->assertSeeIn('@user-info .card-title', $ned->email) | ||||
->with('@user-info form', function (Browser $browser) use ($ned) { | ->with('@user-info form', function (Browser $browser) use ($ned) { | ||||
$browser->assertSeeIn('.row:nth-child(2) label', 'ID (Created)') | $browser->assertSeeIn('.row:nth-child(2) label', 'ID (Created)') | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |