|
|
@@ -27,7 +27,8 @@ it('should returns the customers page', function () {
|
|
|
it('should return listing items of customers', function () {
|
|
|
// Arrange.
|
|
|
$customer = (new CustomerFaker)->factory()->create([
|
|
|
- 'password' => Hash::make('admin123'),
|
|
|
+ 'password' => Hash::make('admin123'),
|
|
|
+ 'customer_source' => 'popup',
|
|
|
]);
|
|
|
|
|
|
// Act and Assert.
|
|
|
@@ -39,13 +40,15 @@ it('should return listing items of customers', function () {
|
|
|
->assertOk()
|
|
|
->assertJsonPath('records.0.customer_id', $customer->id)
|
|
|
->assertJsonPath('records.0.email', $customer->email)
|
|
|
- ->assertJsonPath('records.0.full_name', $customer->name);
|
|
|
+ ->assertJsonPath('records.0.full_name', $customer->name)
|
|
|
+ ->assertJsonPath('records.0.customer_source', 'popup');
|
|
|
});
|
|
|
|
|
|
it('should return the view page of customer', function () {
|
|
|
// Arrange.
|
|
|
$customer = (new CustomerFaker)->factory()->create([
|
|
|
- 'password' => Hash::make('admin123'),
|
|
|
+ 'password' => Hash::make('admin123'),
|
|
|
+ 'customer_source' => 'popup',
|
|
|
]);
|
|
|
|
|
|
// Act and Assert.
|
|
|
@@ -58,6 +61,7 @@ it('should return the view page of customer', function () {
|
|
|
->assertSeeText($customer->gender)
|
|
|
->assertSeeText($customer->email)
|
|
|
->assertSeeText($customer->phone)
|
|
|
+ ->assertSeeText('popup')
|
|
|
->assertSeeText(trans('admin::app.customers.customers.view.title'));
|
|
|
});
|
|
|
|