actingAs(User::factory()->create()); DB::table('system_settings')->updateOrInsert( ['key' => 'supplier_export_mode'], ['value' => 'batch', 'type' => 'string', 'updated_at' => now()], ); $this->getJson('/api/admin/supplier-integration/export-mode') ->assertOk() ->assertJson(['mode' => 'batch']); }); it('POST export-mode switches value', function (): void { $this->actingAs(User::factory()->create()); DB::table('system_settings')->updateOrInsert( ['key' => 'supplier_export_mode'], ['value' => 'batch', 'type' => 'string', 'updated_at' => now()], ); $this->postJson('/api/admin/supplier-integration/export-mode', ['mode' => 'online']) ->assertOk() ->assertJson(['mode' => 'online']); expect(DB::table('system_settings')->where('key', 'supplier_export_mode')->value('value')) ->toBe('online'); }); it('POST export-mode rejects invalid value', function (): void { $this->actingAs(User::factory()->create()); $this->postJson('/api/admin/supplier-integration/export-mode', ['mode' => 'turbo']) ->assertStatus(422); });