Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

1.4 KB
Raw Blame
<?php

declare(strict_types=1);

use App\Enums\Post\Status;

test('post status has correct values', function () {
    expect(Status::Draft->value)->toBe('draft');
    expect(Status::Scheduled->value)->toBe('scheduled');
    expect(Status::Publishing->value)->toBe('publishing');
    expect(Status::Published->value)->toBe('published');
    expect(Status::Failed->value)->toBe('failed');
});

test('post status has labels', function () {
    expect(Status::Draft->label())->toBe('Draft');
    expect(Status::Scheduled->label())->toBe('Scheduled');
    expect(Status::Publishing->label())->toBe('Publishing');
    expect(Status::Published->label())->toBe('Published');
    expect(Status::Failed->label())->toBe('Failed');
});

test('settled statuses are the ones finalize must not rewrite', function () {
    expect(Status::Draft->isSettled())->toBeFalse();
    expect(Status::Scheduled->isSettled())->toBeFalse();
    expect(Status::Publishing->isSettled())->toBeFalse();
    expect(Status::Published->isSettled())->toBeTrue();
    expect(Status::Failed->isSettled())->toBeTrue();
});

test('post status has colors', function () {
    expect(Status::Draft->color())->toBe('gray');
    expect(Status::Scheduled->color())->toBe('blue');
    expect(Status::Publishing->color())->toBe('yellow');
    expect(Status::Published->color())->toBe('green');
    expect(Status::Failed->color())->toBe('red');
});