1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-03-14 19:59:38 +01:00

Allow users to bulk-submit links, lists and tags (#26)

This commit is contained in:
Kovah 2024-09-23 22:41:47 +02:00
parent 9961afd310
commit a386532b2a
No known key found for this signature in database
GPG Key ID: AAAA031BA9830D7B

View File

@ -12,9 +12,15 @@ class BulkStoreApiTest extends TestCase
{
use RefreshDatabase;
private User $user;
protected function setUp(): void
{
parent::setUp();
$this->user = User::factory()->create();
$this->actingAs($this->user);
Queue::fake();
}
@ -30,7 +36,7 @@ class BulkStoreApiTest extends TestCase
'duckduckgo.com' => Http::response($testHtml),
]);
$response = $this->post('api/v2/bulk/links', [
$response = $this->postJson('api/v2/bulk/links', [
'models' => [
[
'url' => 'https://example.com',
@ -72,7 +78,7 @@ class BulkStoreApiTest extends TestCase
public function testStoreLists(): void
{
$response = $this->post('api/v2/bulk/lists', [
$response = $this->postJson('api/v2/bulk/lists', [
'models' => [
[
'name' => 'Example List',
@ -108,7 +114,7 @@ class BulkStoreApiTest extends TestCase
public function testStoreTags(): void
{
$response = $this->post('api/v2/bulk/tags', [
$response = $this->postJson('api/v2/bulk/tags', [
'models' => [
[
'name' => 'tag-a',