init
This commit is contained in:
52 files changed
+5299
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use MeghdadFadaee\NovaFormCard\Http\Responses\FormCardResponse;
|
||||
|
||||
it('formats message responses', function (): void {
|
||||
expect(FormCardResponse::message('Done.')->toArray())->toBe([
|
||||
'type' => 'success',
|
||||
'message' => 'Done.',
|
||||
]);
|
||||
});
|
||||
|
||||
it('formats error responses', function (): void {
|
||||
expect(FormCardResponse::error('Failed.')->toArray())->toBe([
|
||||
'type' => 'error',
|
||||
'message' => 'Failed.',
|
||||
]);
|
||||
});
|
||||
|
||||
it('formats redirect responses', function (): void {
|
||||
expect(FormCardResponse::visit('/resources/users', ['preserveScroll' => true])->toArray())->toBe([
|
||||
'type' => 'redirect',
|
||||
'redirect' => [
|
||||
'url' => '/resources/users',
|
||||
'remote' => false,
|
||||
'options' => [
|
||||
'preserveScroll' => true,
|
||||
],
|
||||
],
|
||||
]);
|
||||
});
|
||||
|
||||
it('formats refresh responses', function (): void {
|
||||
expect(FormCardResponse::refresh('Updated.')->toArray())->toBe([
|
||||
'type' => 'refresh',
|
||||
'message' => 'Updated.',
|
||||
'refresh' => true,
|
||||
]);
|
||||
});
|
||||
Reference in new issue
Block a user