<?php

/*
|--------------------------------------------------------------------------
| Dictionary Item API Tests
|--------------------------------------------------------------------------
|
| Feature tests for the /api/v1/dictionary-items endpoint
|
*/

it('returns a successful response for dictionary items index', function () {
    $response = $this->getJson('/api/v1/dictionary-items');

    $response->assertStatus(200);
});

it('returns dictionary items as array', function () {
    $response = $this->getJson('/api/v1/dictionary-items');

    $response->assertStatus(200);

    $data = $response->json();
    expect($data)->toBeArray();
});

it('can filter dictionary items by letter', function () {
    $response = $this->getJson('/api/v1/dictionary-items?letter=A');

    $response->assertStatus(200);
});

it('can order dictionary items alphabetically', function () {
    $response = $this->getJson('/api/v1/dictionary-items?orderBy=alphabetical');

    $response->assertStatus(200);
});

it('can order dictionary items by latest', function () {
    $response = $this->getJson('/api/v1/dictionary-items?orderBy=latest');

    $response->assertStatus(200);
});
