forked from linuxserver/Heimdall
-
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.
- Loading branch information
Showing
17 changed files
with
360 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Item; | ||
use App\ItemTag; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class ItemTagFactory extends Factory | ||
{ | ||
/** | ||
* The name of the factory's corresponding model. | ||
* | ||
* @var string | ||
*/ | ||
protected $model = ItemTag::class; | ||
|
||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array | ||
*/ | ||
public function definition(): array | ||
{ | ||
return []; | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,50 @@ | ||
APP_NAME=Heimdall | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=false | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=daily | ||
|
||
DB_CONNECTION=sqlite | ||
DB_DATABASE=test.sqlite | ||
|
||
#DB_CONNECTION=<mysql | pgsql> | ||
#DB_HOST=<hostname | ip> | ||
#DB_PORT=<port number> | ||
#DB_DATABASE=<database> | ||
#DB_USERNAME=<user> | ||
#DB_PASSWORD=<password> | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
QUEUE_DRIVER=sync | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS=null | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
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,83 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use App\Item; | ||
use App\ItemTag; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Tests\TestCase; | ||
|
||
class DashTest extends TestCase | ||
{ | ||
use RefreshDatabase; | ||
|
||
/** | ||
* Helpers | ||
*/ | ||
|
||
private function addPinnedItemWithTitleToDB($title) | ||
{ | ||
$item = Item::factory() | ||
->create([ | ||
'title' => $title, | ||
'pinned' => 1, | ||
]); | ||
|
||
ItemTag::factory()->create([ | ||
'item_id' => $item->id, | ||
'tag_id' => 0, | ||
]); | ||
} | ||
|
||
private function addTagWithTitleToDB($title) | ||
{ | ||
Item::factory() | ||
->create([ | ||
'title' => $title, | ||
'type' => 1, | ||
]); | ||
} | ||
|
||
/** | ||
* Test Cases | ||
*/ | ||
|
||
public function test_loads_empty_dash() | ||
{ | ||
$this->seed(); | ||
|
||
$response = $this->get('/'); | ||
|
||
$response->assertStatus(200); | ||
} | ||
|
||
public function test_displays_items_on_the_dash() | ||
{ | ||
$this->seed(); | ||
|
||
$this->addPinnedItemWithTitleToDB('Item 1'); | ||
$this->addPinnedItemWithTitleToDB('Item 2'); | ||
$this->addPinnedItemWithTitleToDB('Item 3'); | ||
|
||
$response = $this->get('/'); | ||
|
||
$response->assertStatus(200); | ||
$response->assertSee('Item 1'); | ||
$response->assertSee('Item 2'); | ||
$response->assertSee('Item 3'); | ||
} | ||
|
||
public function test_displays_tags_on_the_dash() | ||
{ | ||
$this->seed(); | ||
|
||
$this->addTagWithTitleToDB('Tag 1'); | ||
$this->addTagWithTitleToDB('Tag 2'); | ||
|
||
$response = $this->get('/'); | ||
|
||
$response->assertStatus(200); | ||
$response->assertSee('Tag 1'); | ||
$response->assertSee('Tag 2'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Tests\TestCase; | ||
|
||
class ItemCreateTest extends TestCase | ||
{ | ||
use RefreshDatabase; | ||
|
||
public function test_displays_the_item_create_page() | ||
{ | ||
$this->seed(); | ||
|
||
$response = $this->get('/items/create'); | ||
|
||
$response->assertStatus(200); | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
public function test_display_the_home_dashboard_tag() | ||
{ | ||
$this->seed(); | ||
|
||
$response = $this->get('/items/create'); | ||
|
||
$response->assertSee('Home dashboard'); | ||
} | ||
} |
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,34 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use App\Item; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Tests\TestCase; | ||
|
||
class ItemListTest extends TestCase | ||
{ | ||
use RefreshDatabase; | ||
|
||
protected function addItemWithTitleToDB($title) | ||
{ | ||
Item::factory() | ||
->create([ | ||
'title' => $title | ||
]); | ||
} | ||
|
||
public function test_displays_items_on_the_item_list_page() | ||
{ | ||
$this->addItemWithTitleToDB('Item 1'); | ||
$this->addItemWithTitleToDB('Item 2'); | ||
$this->addItemWithTitleToDB('Item 3'); | ||
|
||
$response = $this->get('/items'); | ||
|
||
$response->assertStatus(200); | ||
$response->assertSee('Item 1'); | ||
$response->assertSee('Item 2'); | ||
$response->assertSee('Item 3'); | ||
} | ||
} |
Oops, something went wrong.