Level 102
If product name is empty it wont test it
dd($product->name));
What does this give you?
Summer Sale! All accounts are 50% off this week.
Hi!
I have written a test that checks if the product name is visible on the page. The problem is that the assertSee is not performed when doing the test. assertOK works.
Test
$this->actingAs($this->admin);
$product = Product::factory()->create();
$response = $this->get("/product/{$product->internal_item_number}/{$product->slug}");
$response->assertOk();
$response->assertSee($product->name);
Result
OK (1 test, 1 assertion)
If I remove $response->assertOk(), this is the result
OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Risky: 1.
So it seems that $response->assertSee($product->name) is not executed. I have used this in multiple other tests, and it has worked as expected. Is there anything I am missing here?
If product name is empty it wont test it
dd($product->name));
What does this give you?
Please or to participate in this conversation.