-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
3d67dec
commit 53ae281
Showing
13 changed files
with
146 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
database/migrations/2024_09_16_135335_add_schedule_link_to_settings_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration { | ||
public function up(): void | ||
{ | ||
Schema::table("settings", function (Blueprint $table): void { | ||
$table->string("schedule_link")->nullable()->default(null); | ||
}); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
Schema::table("settings", function (Blueprint $table): void { | ||
$table->dropColumn("schedule_link"); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Feature; | ||
|
||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Inertia\Testing\AssertableInertia; | ||
use Keating\Models\Setting; | ||
use Keating\Models\User; | ||
use Tests\TestCase; | ||
|
||
class SettingsScheduleLinkTest extends TestCase | ||
{ | ||
use RefreshDatabase; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->user = User::factory()->create(); | ||
$this->actingAs($this->user); | ||
} | ||
|
||
public function testMainPageWhenNoScheduleLinkInSetting(): void | ||
{ | ||
Setting::factory()->create([ | ||
"teacher_name" => "Ty Doe", | ||
"teacher_email" => "ty.doe@exmple.com", | ||
"teacher_titles" => "dr inż.", | ||
"university_name" => "CWUP", | ||
"department_name" => "IT department", | ||
"schedule_link" => null, | ||
"primary_color" => "#000000", | ||
"secondary_color" => "#ffffff", | ||
]); | ||
|
||
$this->get("/")->assertInertia(function (AssertableInertia $page): void { | ||
$page->has("settings")->where("settings.scheduleLink", null); | ||
}); | ||
} | ||
|
||
public function testMainPageWhenScheduleLinkInSetting(): void | ||
{ | ||
Setting::factory()->create([ | ||
"teacher_name" => "Ty Doe", | ||
"teacher_email" => "ty.doe@exmple.com", | ||
"teacher_titles" => "dr inż.", | ||
"university_name" => "CWUP", | ||
"department_name" => "IT department", | ||
"schedule_link" => "https://google.com/", | ||
"primary_color" => "#000000", | ||
"secondary_color" => "#ffffff", | ||
]); | ||
|
||
$this->get("/")->assertInertia(function (AssertableInertia $page): void { | ||
$page->has("settings")->where("settings.scheduleLink", "https://google.com/"); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters