<?php

declare(strict_types=1);

usesApiSuite();

it('returns the running API commit in worker status', function (): void {
    api_test_covers('GET /worker/status', 'happy');

    $response = api_client()->get('/worker/status');

    $response
        ->assertStatus(200)
        ->assertEnvelope()
        ->assertSuccess();

    expect($response->data())
        ->toBeArray()
        ->toHaveKey('api_commit_sha');

    expect($response->data()['api_commit_sha'])
        ->toBeString()
        ->not->toBe('');
});
