mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
update invoice profile
This commit is contained in:
@@ -12,7 +12,7 @@ use Tests\TestCase;
|
||||
|
||||
class LanguageEditorTest extends TestCase
|
||||
{
|
||||
//use DatabaseMigrations;
|
||||
use DatabaseMigrations;
|
||||
|
||||
protected $setup;
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ class OasisClientTest extends TestCase
|
||||
'id' => $client->id,
|
||||
])->assertStatus(200);
|
||||
|
||||
$this->getJson('/api/oasis/clients/search?query=info')
|
||||
$this->getJson('/api/oasis/clients/search?query=inf')
|
||||
->assertJsonFragment([
|
||||
'id' => $client->id,
|
||||
])->assertStatus(200);
|
||||
|
||||
@@ -48,7 +48,10 @@ class OasisInvoiceProfileTest extends TestCase
|
||||
'bank' => 'Fio Banka',
|
||||
'iban' => 'SK20000054236423624',
|
||||
'swift' => 'FIOZXXX',
|
||||
])->assertStatus(201);
|
||||
])->assertStatus(201)
|
||||
->assertJsonFragment([
|
||||
'company' => 'VueFileManager Inc.',
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('invoice_profiles', [
|
||||
'user_id' => $user->id,
|
||||
@@ -61,4 +64,58 @@ class OasisInvoiceProfileTest extends TestCase
|
||||
Storage::disk('local')->assertExists($profile->logo);
|
||||
Storage::disk('local')->assertExists($profile->stamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function user_update_invoice_profile_column()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create(['role' => 'user']);
|
||||
|
||||
InvoiceProfile::factory(InvoiceProfile::class)
|
||||
->create(['user_id' => $user->id]);
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$this->patchJson('/api/oasis/invoices/profile', [
|
||||
'name' => 'company',
|
||||
'value' => 'VueFileManager Inc.',
|
||||
])->assertStatus(204);
|
||||
|
||||
$this->assertDatabaseHas('invoice_profiles', [
|
||||
'user_id' => $user->id,
|
||||
'company' => 'VueFileManager Inc.',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function user_update_invoice_profile_logo()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create(['role' => 'user']);
|
||||
|
||||
InvoiceProfile::factory(InvoiceProfile::class)
|
||||
->create(['user_id' => $user->id]);
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$image = UploadedFile::fake()
|
||||
->image('fake-image.jpg');
|
||||
|
||||
$this->patchJson('/api/oasis/invoices/profile', [
|
||||
'name' => 'logo',
|
||||
'logo' => $image,
|
||||
])->assertStatus(204);
|
||||
|
||||
$this->assertDatabaseMissing('invoice_profiles', [
|
||||
'logo' => null,
|
||||
]);
|
||||
|
||||
Storage::disk('local')->assertExists(
|
||||
InvoiceProfile::first()->logo
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user