Browse Source

Change some text styles in payment print view file

Restructure some test files
pull/1/head
Nafies Luthfi 8 years ago
parent
commit
7c8a163fd0
  1. 8
      resources/views/payments/pdf.blade.php
  2. 10
      tests/Feature/ManageFeaturesTest.php
  3. 53
      tests/Feature/ManageProjectsTest.php
  4. 66
      tests/Feature/ManageTasksTest.php
  5. 2
      tests/Feature/Partners/ManageVendorsTest.php

8
resources/views/payments/pdf.blade.php

@ -10,7 +10,7 @@
table.receipt-table { table.receipt-table {
/*border: 1px solid #aaa;*/ /*border: 1px solid #aaa;*/
border-collapse: collapse; border-collapse: collapse;
font-size:14px;
font-size:16px;
max-width: 750px; max-width: 750px;
} }
table.receipt-table td { table.receipt-table td {
@ -22,10 +22,10 @@
<table class="receipt-table"> <table class="receipt-table">
<tbody> <tbody>
<tr> <tr>
<td style="width:120px;">
{{ Html::image(url('assets/imgs/logo.png'), '', ['style' => 'width:100%']) }}
<td style="width:140px;">
{{ Html::image(url('assets/imgs/logo.png'), '', ['style' => 'width: 100px;']) }}
</td> </td>
<td style="width:350px">
<td style="width:330px">
<div style="width:280px"> <div style="width:280px">
<h4 style="margin:0px; border-bottom: 3px; font-size: 21.5px">JasaWebsiteBanjarmasin.com</h4> <h4 style="margin:0px; border-bottom: 3px; font-size: 21.5px">JasaWebsiteBanjarmasin.com</h4>
<div style="font-size:13px">Jasa Pembuatan Website dan Aplikasi Berbasis Web</div> <div style="font-size:13px">Jasa Pembuatan Website dan Aplikasi Berbasis Web</div>

10
tests/Feature/ManageFeaturesTest.php

@ -47,20 +47,20 @@ class ManageFeaturesTest extends TestCase
/** @test */ /** @test */
public function admin_can_edit_feature_data() public function admin_can_edit_feature_data()
{ {
$user = factory(User::class, 3)->create();
$this->actingAs($user[0]);
$users = factory(User::class, 3)->create();
$this->actingAs($users[0]);
$customer = factory(Customer::class)->create(); $customer = factory(Customer::class)->create();
$project = factory(Project::class)->create(['customer_id' => $customer->id]); $project = factory(Project::class)->create(['customer_id' => $customer->id]);
$feature = factory(Feature::class)->create(['worker_id' => $user[1]->id, 'project_id' => $project->id]);
$feature = factory(Feature::class)->create(['worker_id' => $users[1]->id, 'project_id' => $project->id]);
$this->visit(route('features.edit', $feature->id)); $this->visit(route('features.edit', $feature->id));
$this->submitForm(trans('feature.update'), [ $this->submitForm(trans('feature.update'), [
'name' => 'Nama Fitur Edit', 'name' => 'Nama Fitur Edit',
'price' => 33333, 'price' => 33333,
'worker_id' => $user[2]->id,
'worker_id' => $users[2]->id,
'type_id' => 2, 'type_id' => 2,
]); ]);
@ -71,7 +71,7 @@ class ManageFeaturesTest extends TestCase
$this->seeInDatabase('features', [ $this->seeInDatabase('features', [
'name' => 'Nama Fitur Edit', 'name' => 'Nama Fitur Edit',
'price' => 33333, 'price' => 33333,
'worker_id' => $user[2]->id,
'worker_id' => $users[2]->id,
'project_id' => $project->id, 'project_id' => $project->id,
'type_id' => 2, 'type_id' => 2,
]); ]);

53
tests/Feature/ManageProjectsTest.php

@ -17,20 +17,22 @@ class ManageProjectsTest extends TestCase
$user = $this->adminUserSigningIn(); $user = $this->adminUserSigningIn();
$customer = factory(Customer::class)->create(); $customer = factory(Customer::class)->create();
$this->visit(route('projects.index'));
$this->seePageIs(route('projects.index'));
$this->click(trans('project.create'));
$this->seePageIs(route('projects.create'));
$this->type('Project Baru', 'name');
$this->select($customer->id, 'customer_id');
$this->type('2016-04-15', 'proposal_date');
$this->type('2000000', 'proposal_value');
$this->type('Deskripsi project baru', 'description');
$this->press(trans('project.create'));
$this->visit(route('projects.create'));
$this->submitForm(trans('project.create'), [
'name' => 'Project Baru',
'customer_id' => $customer->id,
'proposal_date' => '2016-04-15',
'proposal_value' => '2000000',
'description' => 'Deskripsi project baru',
]);
$this->see(trans('project.created')); $this->see(trans('project.created'));
$this->see('Project Baru'); $this->see('Project Baru');
$this->seeInDatabase('projects', ['name' => 'Project Baru', 'proposal_value' => '2000000']);
$this->seeInDatabase('projects', [
'name' => 'Project Baru',
'proposal_value' => '2000000',
]);
} }
/** @test */ /** @test */
@ -38,32 +40,37 @@ class ManageProjectsTest extends TestCase
{ {
$user = $this->adminUserSigningIn(); $user = $this->adminUserSigningIn();
$this->visit(route('projects.index'));
$this->seePageIs(route('projects.index'));
$this->click(trans('project.create'));
$this->seePageIs(route('projects.create'));
$this->visit(route('projects.create'));
// Invalid entry // Invalid entry
$this->type('Project Baru', 'name');
$this->select('', 'customer_id');
$this->type('2016-04-15', 'proposal_date');
$this->type('2000000', 'proposal_value');
$this->type('Deskripsi project baru', 'description');
$this->press(trans('project.create'));
$this->submitForm(trans('project.create'), [
'name' => 'Project Baru',
'customer_id' => '',
'proposal_date' => '2016-04-15',
'proposal_value' => '2000000',
'description' => 'Deskripsi project baru',
]);
$this->seePageIs(route('projects.create')); $this->seePageIs(route('projects.create'));
$this->notSeeInDatabase('projects', ['name' => 'Project Baru', 'proposal_value' => '2000000']);
$this->notSeeInDatabase('projects', [
'name' => 'Project Baru',
'proposal_value' => '2000000',
]);
$this->type('Customer Baru', 'customer_name'); $this->type('Customer Baru', 'customer_name');
$this->type('email@customer.baru', 'customer_email'); $this->type('email@customer.baru', 'customer_email');
$this->press(trans('project.create')); $this->press(trans('project.create'));
$this->see(trans('project.created')); $this->see(trans('project.created'));
$this->see('Project Baru');
$this->seeInDatabase('customers', [ $this->seeInDatabase('customers', [
'name' => 'Customer Baru', 'name' => 'Customer Baru',
'email' => 'email@customer.baru', 'email' => 'email@customer.baru',
]); ]);
$newCustomer = Customer::whereName('Customer Baru')->whereEmail('email@customer.baru')->first(); $newCustomer = Customer::whereName('Customer Baru')->whereEmail('email@customer.baru')->first();
$this->seeInDatabase('projects', [ $this->seeInDatabase('projects', [
'name' => 'Project Baru', 'name' => 'Project Baru',
'proposal_value' => '2000000', 'proposal_value' => '2000000',

66
tests/Feature/ManageTasksTest.php

@ -3,7 +3,6 @@
namespace Tests\Feature; namespace Tests\Feature;
use App\Entities\Projects\Feature; use App\Entities\Projects\Feature;
use App\Entities\Projects\Project;
use App\Entities\Projects\Task; use App\Entities\Projects\Task;
use Tests\TestCase; use Tests\TestCase;
@ -13,28 +12,29 @@ class ManageTasksTest extends TestCase
public function admin_can_entry_task() public function admin_can_entry_task()
{ {
$user = $this->adminUserSigningIn(); $user = $this->adminUserSigningIn();
$project = factory(Project::class)->create();
$feature = factory(Feature::class)->create(['worker_id' => $user->id]);
$feature = factory(Feature::class)->create(['worker_id' => $user->id, 'project_id' => $project->id]);
$this->visit('features/'.$feature->id);
$this->seePageIs('features/'.$feature->id);
$this->visit(route('features.show', $feature->id));
$this->seePageIs(route('features.show', $feature->id));
$this->see(trans('feature.tasks')); $this->see(trans('feature.tasks'));
$this->see(trans('task.create'));
// Fill Form // Fill Form
$this->type('Nama Task Baru', 'name');
$this->type('Ipsam magnam laboriosam distinctio officia facere sapiente eius corporis', 'description');
$this->type(70, 'progress');
$this->type('tasks/create', 'route_name');
$this->press(trans('task.create'));
$this->submitForm(trans('task.create'), [
'name' => 'Nama Task Baru',
'description' => 'Deskripsi task yang dikerjakani.',
'progress' => 70,
'route_name' => 'tasks/create',
]);
$this->seePageIs('features/'.$feature->id);
$this->seePageIs(route('features.show', $feature->id));
$this->see(trans('task.created')); $this->see(trans('task.created'));
$this->seeInDatabase('tasks', [ $this->seeInDatabase('tasks', [
'name' => 'Nama Task Baru',
'progress' => 70,
'feature_id' => $feature->id,
'route_name' => 'tasks/create',
'name' => 'Nama Task Baru',
'description' => 'Deskripsi task yang dikerjakani.',
'progress' => 70,
'feature_id' => $feature->id,
'route_name' => 'tasks/create',
]); ]);
} }
@ -42,25 +42,23 @@ class ManageTasksTest extends TestCase
public function admin_can_edit_task_data() public function admin_can_edit_task_data()
{ {
$user = $this->adminUserSigningIn(); $user = $this->adminUserSigningIn();
$project = factory(Project::class)->create();
$feature = factory(Feature::class)->create(['worker_id' => $user->id, 'project_id' => $project->id]);
$task = factory(Task::class)->create(['feature_id' => $feature->id]);
$feature = factory(Feature::class)->create(['worker_id' => $user->id]);
$task = factory(Task::class)->create(['feature_id' => $feature->id]);
$this->visit('features/'.$feature->id);
$this->visit(route('features.show', $feature->id));
$this->click($task->id.'-tasks-edit'); $this->click($task->id.'-tasks-edit');
$this->seePageIs('features/'.$feature->id.'?action=task_edit&task_id='.$task->id);
$this->seePageIs(route('features.show', [$feature->id, 'action' => 'task_edit', 'task_id' => $task->id]));
$this->see(trans('task.edit')); $this->see(trans('task.edit'));
$this->see(trans('task.update'));
// Fill Form // Fill Form
$this->type('Nama Task Edit', 'name');
$this->type(77, 'progress');
$this->press(trans('task.update'));
$this->submitForm(trans('task.update'), [
'name' => 'Nama Task Edit',
'progress' => 77,
]);
$this->seePageIs('features/'.$feature->id);
$this->seePageIs(route('features.show', $feature->id));
$this->see(trans('task.updated')); $this->see(trans('task.updated'));
$this->seeInDatabase('tasks', [ $this->seeInDatabase('tasks', [
'name' => 'Nama Task Edit', 'name' => 'Nama Task Edit',
'progress' => 77, 'progress' => 77,
@ -72,17 +70,15 @@ class ManageTasksTest extends TestCase
public function admin_can_delete_a_task() public function admin_can_delete_a_task()
{ {
$user = $this->adminUserSigningIn(); $user = $this->adminUserSigningIn();
$project = factory(Project::class)->create();
$feature = factory(Feature::class)->create(['worker_id' => $user->id, 'project_id' => $project->id]);
$feature = factory(Feature::class)->create(['worker_id' => $user->id]);
$task = factory(Task::class)->create(['feature_id' => $feature->id]);
$task = factory(Task::class)->create(['feature_id' => $feature->id]);
$this->visit('features/'.$feature->id);
$this->visit(route('features.show', $feature->id));
$this->click($task->id.'-tasks-delete'); $this->click($task->id.'-tasks-delete');
$this->see(trans('app.delete_confirm_button')); $this->see(trans('app.delete_confirm_button'));
$this->press(trans('app.delete_confirm_button')); $this->press(trans('app.delete_confirm_button'));
$this->seePageIs('features/'.$feature->id);
$this->seePageIs(route('features.show', $feature->id));
$this->see(trans('task.deleted')); $this->see(trans('task.deleted'));
} }
} }

2
tests/Feature/ManageVendorsTest.php → tests/Feature/Partners/ManageVendorsTest.php

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature;
namespace Tests\Feature\Partners;
use App\Entities\Partners\Vendor; use App\Entities\Partners\Vendor;
use Tests\TestCase as TestCase; use Tests\TestCase as TestCase;
Loading…
Cancel
Save