From eb3d852dae7f3c993c3628a3b23e86a555dfe4f0 Mon Sep 17 00:00:00 2001 From: A1Gard Date: Sun, 3 Sep 2023 04:47:27 +0330 Subject: [PATCH] added websites tests: - index - products - posts - single post - single product - single product category - card empty - card with products --- tests/Feature/websitePagesTest.php | 67 ++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tests/Feature/websitePagesTest.php diff --git a/tests/Feature/websitePagesTest.php b/tests/Feature/websitePagesTest.php new file mode 100644 index 0000000..78e7bb3 --- /dev/null +++ b/tests/Feature/websitePagesTest.php @@ -0,0 +1,67 @@ +get('/'); + + $response->assertStatus(200); + } + public function test_products() + { + $response = $this->get(route('products')); + + $response->assertStatus(200); + } + public function test_posts() + { + $response = $this->get(route('posts')); + + $response->assertStatus(200); + } + public function test_single_post() + { + $response = $this->get(route('post',Post::inRandomOrder()->first()->slug)); + + $response->assertStatus(200); + } + public function test_single_product() + { + $response = $this->get(route('product',Product::inRandomOrder()->first()->slug)); + + $response->assertStatus(200); + } + + public function test_single_product_category() + { + $response = $this->get(route('cat',Cat::inRandomOrder()->first()->slug)); + $response->assertStatus(200); + } + + public function test_card_empty(){ + $this->get(route('reset')); + $response = $this->get(route('card.show')); + $response->assertStatus(200); + } + public function test_card_with_products(){ + $this->get(route('card.add',Product::inRandomOrder()->first()->slug)); + $this->get(route('card.add',Product::inRandomOrder()->first()->slug)); + $response = $this->get(route('card.show')); + $response->assertStatus(200); + } +}