trypost/tests/Feature/Automation/Node/EndNodeTest.php
Paulo Castellano b23ab0166e feat(automations): implement automation features and UI enhancements
- Added new automation-related routes and controllers for managing automations.
- Introduced automation nodes in the UI with distinct styles and interactions.
- Updated sidebar to include navigation for automations.
- Enhanced post creation logic to support automation metadata.
- Refactored content type and platform enums into types for better type safety.
- Added localization for automation-related terms in English, Spanish, and Portuguese.
- Improved error handling in various components to accommodate new features.
2026-05-24 09:17:19 -03:00

24 lines
748 B
PHP

<?php
use App\Actions\Automation\Node\RunEndNode;
use App\Enums\Automation\NodeRun\Status;
use App\Models\AutomationRun;
it('returns completed with ended_at timestamp', function () {
$run = AutomationRun::factory()->create();
$result = app(RunEndNode::class)($run, []);
expect($result->status)->toBe(Status::Completed);
expect($result->output)->toHaveKey('end');
expect($result->output['end'])->toHaveKey('ended_at');
expect($result->output['end']['reason'])->toBeNull();
});
it('captures reason from config', function () {
$run = AutomationRun::factory()->create();
$result = app(RunEndNode::class)($run, ['reason' => 'Filtered out']);
expect($result->output['end']['reason'])->toBe('Filtered out');
});