- integrate spatie/icalendar-generator for candidate & panelist .ics invitations (RSVP & 15m alerts)
- add StoreInterviewRequest, ScheduleInterviewDto, and invitation/reminder queued actions
- add migration for job_title, round, description, and reminder_sent_at on interviews table
- style datetime-local picker indicators to pure white on dark input backgrounds
- support button loading spinners with :showLoader="true" and loadingText
- auto-open schedule drawer on validation failure with inline @error alerts and old() bindings
61 lines
2.2 KiB
PHP
61 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\DTOs\Interview\ScheduleInterviewDto;
|
|
use Carbon\Carbon;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ScheduleInterviewDtoTest extends TestCase
|
|
{
|
|
public function test_can_instantiate_and_convert_dto(): void
|
|
{
|
|
$dto = new ScheduleInterviewDto(
|
|
candidateName: 'Soumyadeep Mondal',
|
|
candidateEmail: 'soumyadeep@example.com',
|
|
candidatePhone: '9876543210',
|
|
jobTitle: 'AIML (Computer Vision & Agentic AI) Engineer',
|
|
round: 'R1',
|
|
scheduledAt: Carbon::parse('2026-08-11 17:00:00'),
|
|
validHours: 2,
|
|
language: 'python',
|
|
assignedInterviewers: [1, 2],
|
|
description: 'Test notes',
|
|
);
|
|
|
|
$this->assertEquals('Soumyadeep Mondal', $dto->candidateName);
|
|
$this->assertEquals('soumyadeep@example.com', $dto->candidateEmail);
|
|
$this->assertEquals('AIML (Computer Vision & Agentic AI) Engineer', $dto->jobTitle);
|
|
$this->assertEquals('R1', $dto->round);
|
|
$this->assertEquals(2, $dto->validHours);
|
|
$this->assertEquals([1, 2], $dto->assignedInterviewers);
|
|
$this->assertEquals('Test notes', $dto->description);
|
|
|
|
$array = $dto->toArray();
|
|
$this->assertIsArray($array);
|
|
$this->assertEquals('Soumyadeep Mondal', $array['candidate_name']);
|
|
$this->assertEquals('R1', $array['round']);
|
|
}
|
|
|
|
public function test_dto_from_array(): void
|
|
{
|
|
$dto = ScheduleInterviewDto::fromArray([
|
|
'candidate_name' => 'Jane Doe',
|
|
'candidate_email' => 'jane@example.com',
|
|
'candidate_phone' => '1234567890',
|
|
'job_title' => 'Fullstack Developer',
|
|
'round' => 'Technical Round',
|
|
'valid_hours' => 4,
|
|
'language' => 'javascript',
|
|
'assigned_interviewers' => [5],
|
|
]);
|
|
|
|
$this->assertEquals('Jane Doe', $dto->candidateName);
|
|
$this->assertEquals('Technical Round', $dto->round);
|
|
$this->assertEquals('Fullstack Developer', $dto->jobTitle);
|
|
$this->assertEquals(4, $dto->validHours);
|
|
$this->assertEquals('javascript', $dto->language);
|
|
$this->assertEquals([5], $dto->assignedInterviewers);
|
|
}
|
|
}
|