|
|
@ -22,18 +22,18 @@ class ManageFeaturesTest extends TestCase |
|
|
$worker = factory(User::class)->create(); |
|
|
$worker = factory(User::class)->create(); |
|
|
$worker->assignRole('worker'); |
|
|
$worker->assignRole('worker'); |
|
|
|
|
|
|
|
|
$this->visit('projects/' . $project->id . '/features'); |
|
|
|
|
|
$this->seePageIs('projects/' . $project->id . '/features'); |
|
|
|
|
|
|
|
|
$this->visit('projects/'.$project->id.'/features'); |
|
|
|
|
|
$this->seePageIs('projects/'.$project->id.'/features'); |
|
|
$this->see(trans('project.features')); |
|
|
$this->see(trans('project.features')); |
|
|
$this->click(trans('feature.create')); |
|
|
$this->click(trans('feature.create')); |
|
|
$this->seePageIs('projects/' . $project->id . '/features/create'); |
|
|
|
|
|
|
|
|
$this->seePageIs('projects/'.$project->id.'/features/create'); |
|
|
|
|
|
|
|
|
// Fill Form
|
|
|
// Fill Form
|
|
|
$this->type('Nama Fitur Baru','name'); |
|
|
|
|
|
$this->type(100000,'price'); |
|
|
|
|
|
|
|
|
$this->type('Nama Fitur Baru', 'name'); |
|
|
|
|
|
$this->type(100000, 'price'); |
|
|
$this->select($worker->id, 'worker_id'); |
|
|
$this->select($worker->id, 'worker_id'); |
|
|
$this->select(1, 'type_id'); |
|
|
$this->select(1, 'type_id'); |
|
|
$this->type('Similique, eligendi fuga animi? Ipsam magnam laboriosam distinctio officia facere sapiente eius corporis','description'); |
|
|
|
|
|
|
|
|
$this->type('Similique, eligendi fuga animi? Ipsam magnam laboriosam distinctio officia facere sapiente eius corporis', 'description'); |
|
|
$this->press(trans('feature.create')); |
|
|
$this->press(trans('feature.create')); |
|
|
|
|
|
|
|
|
$this->see(trans('feature.created')); |
|
|
$this->see(trans('feature.created')); |
|
|
@ -59,17 +59,17 @@ class ManageFeaturesTest extends TestCase |
|
|
|
|
|
|
|
|
$feature = factory(Feature::class)->create(['worker_id' => $user[1]->id, 'project_id' => $project->id]); |
|
|
$feature = factory(Feature::class)->create(['worker_id' => $user[1]->id, 'project_id' => $project->id]); |
|
|
|
|
|
|
|
|
$this->visit('features/' . $feature->id . '/edit'); |
|
|
|
|
|
$this->seePageIs('features/' . $feature->id . '/edit'); |
|
|
|
|
|
|
|
|
$this->visit('features/'.$feature->id.'/edit'); |
|
|
|
|
|
$this->seePageIs('features/'.$feature->id.'/edit'); |
|
|
|
|
|
|
|
|
// Fill Form
|
|
|
// Fill Form
|
|
|
$this->type('Nama Fitur Edit','name'); |
|
|
|
|
|
$this->type(33333,'price'); |
|
|
|
|
|
$this->select($user[2]->id,'worker_id'); |
|
|
|
|
|
|
|
|
$this->type('Nama Fitur Edit', 'name'); |
|
|
|
|
|
$this->type(33333, 'price'); |
|
|
|
|
|
$this->select($user[2]->id, 'worker_id'); |
|
|
$this->select(2, 'type_id'); |
|
|
$this->select(2, 'type_id'); |
|
|
$this->press(trans('feature.update')); |
|
|
$this->press(trans('feature.update')); |
|
|
|
|
|
|
|
|
$this->seePageIs('features/' . $feature->id); |
|
|
|
|
|
|
|
|
$this->seePageIs('features/'.$feature->id); |
|
|
$this->see(trans('feature.updated')); |
|
|
$this->see(trans('feature.updated')); |
|
|
$this->seeInDatabase('features', [ |
|
|
$this->seeInDatabase('features', [ |
|
|
'name' => 'Nama Fitur Edit', |
|
|
'name' => 'Nama Fitur Edit', |
|
|
@ -97,17 +97,17 @@ class ManageFeaturesTest extends TestCase |
|
|
'project_id' => $project->id, |
|
|
'project_id' => $project->id, |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
// $this->visit('projects/' . $project->id . '/features');
|
|
|
|
|
|
// $this->seePageIs('projects/' . $project->id . '/features');
|
|
|
|
|
|
// $this->click('show-feature-' . $feature->id);
|
|
|
|
|
|
|
|
|
// $this->visit('projects/'.$project->id.'/features');
|
|
|
|
|
|
// $this->seePageIs('projects/'.$project->id.'/features');
|
|
|
|
|
|
// $this->click('show-feature-'.$feature->id);
|
|
|
// $this->dump();
|
|
|
// $this->dump();
|
|
|
$this->visit('features/' . $feature->id); |
|
|
|
|
|
$this->seePageIs('features/' . $feature->id); |
|
|
|
|
|
|
|
|
$this->visit('features/'.$feature->id); |
|
|
|
|
|
$this->seePageIs('features/'.$feature->id); |
|
|
// die('hit');
|
|
|
// die('hit');
|
|
|
$this->click(trans('app.edit')); |
|
|
$this->click(trans('app.edit')); |
|
|
$this->click(trans('feature.delete')); |
|
|
$this->click(trans('feature.delete')); |
|
|
$this->press(trans('app.delete_confirm_button')); |
|
|
$this->press(trans('app.delete_confirm_button')); |
|
|
$this->seePageIs('projects/' . $project->id . '/features'); |
|
|
|
|
|
|
|
|
$this->seePageIs('projects/'.$project->id.'/features'); |
|
|
$this->see(trans('feature.deleted')); |
|
|
$this->see(trans('feature.deleted')); |
|
|
|
|
|
|
|
|
$this->notSeeInDatabase('features', [ |
|
|
$this->notSeeInDatabase('features', [ |
|
|
@ -131,9 +131,9 @@ class ManageFeaturesTest extends TestCase |
|
|
$project = factory(Project::class)->create(['owner_id' => $user->id]); |
|
|
$project = factory(Project::class)->create(['owner_id' => $user->id]); |
|
|
$feature = factory(Feature::class)->create(['project_id' => $project->id,'type_id' => 1]); |
|
|
$feature = factory(Feature::class)->create(['project_id' => $project->id,'type_id' => 1]); |
|
|
|
|
|
|
|
|
$this->visit('projects/' . $project->id . '/features'); |
|
|
|
|
|
$this->click('show-feature-' . $feature->id); |
|
|
|
|
|
$this->seePageIs('features/' . $feature->id); |
|
|
|
|
|
|
|
|
$this->visit('projects/'.$project->id.'/features'); |
|
|
|
|
|
$this->click('show-feature-'.$feature->id); |
|
|
|
|
|
$this->seePageIs('features/'.$feature->id); |
|
|
$this->see(trans('feature.show')); |
|
|
$this->see(trans('feature.show')); |
|
|
$this->see($feature->name); |
|
|
$this->see($feature->name); |
|
|
$this->see(formatRp($feature->price)); |
|
|
$this->see(formatRp($feature->price)); |
|
|
@ -152,42 +152,42 @@ class ManageFeaturesTest extends TestCase |
|
|
$tasks1 = factory(Task::class, 3)->create(['feature_id' => $features[0]->id]); |
|
|
$tasks1 = factory(Task::class, 3)->create(['feature_id' => $features[0]->id]); |
|
|
$tasks2 = factory(Task::class, 3)->create(['feature_id' => $features[1]->id]); |
|
|
$tasks2 = factory(Task::class, 3)->create(['feature_id' => $features[1]->id]); |
|
|
|
|
|
|
|
|
$this->visit('projects/' . $projects[1]->id . '/features'); |
|
|
|
|
|
$this->seePageIs('projects/' . $projects[1]->id . '/features'); |
|
|
|
|
|
|
|
|
$this->visit('projects/'.$projects[1]->id.'/features'); |
|
|
|
|
|
$this->seePageIs('projects/'.$projects[1]->id.'/features'); |
|
|
$this->click(trans('feature.add_from_other_project')); |
|
|
$this->click(trans('feature.add_from_other_project')); |
|
|
$this->seePageIs('projects/' . $projects[1]->id . '/features/add-from-other-project'); |
|
|
|
|
|
|
|
|
$this->seePageIs('projects/'.$projects[1]->id.'/features/add-from-other-project'); |
|
|
$this->select($projects[0]->id, 'project_id'); |
|
|
$this->select($projects[0]->id, 'project_id'); |
|
|
$this->press('Lihat Fitur'); |
|
|
$this->press('Lihat Fitur'); |
|
|
$this->seePageIs('projects/' . $projects[1]->id . '/features/add-from-other-project?project_id=' . $projects[0]->id); |
|
|
|
|
|
|
|
|
$this->seePageIs('projects/'.$projects[1]->id.'/features/add-from-other-project?project_id='.$projects[0]->id); |
|
|
|
|
|
|
|
|
// $this->submitForm(trans('feature.create'), [
|
|
|
// $this->submitForm(trans('feature.create'), [
|
|
|
// 'feature_ids' => [$features[0]->id,$features[1]->id],
|
|
|
// 'feature_ids' => [$features[0]->id,$features[1]->id],
|
|
|
// $features[0]->id . '_task_ids' => [$tasks1[0]->id,$tasks1[1]->id,$tasks1[2]->id],
|
|
|
|
|
|
// $features[1]->id . '_task_ids' => [$tasks2[0]->id,$tasks2[1]->id,$tasks2[2]->id],
|
|
|
|
|
|
|
|
|
// $features[0]->id.'_task_ids' => [$tasks1[0]->id,$tasks1[1]->id,$tasks1[2]->id],
|
|
|
|
|
|
// $features[1]->id.'_task_ids' => [$tasks2[0]->id,$tasks2[1]->id,$tasks2[2]->id],
|
|
|
// ]);
|
|
|
// ]);
|
|
|
|
|
|
|
|
|
// $this->check('feature_ids[0]');
|
|
|
// $this->check('feature_ids[0]');
|
|
|
// $this->check('feature_ids[1]');
|
|
|
// $this->check('feature_ids[1]');
|
|
|
// $this->check($features[0]->id . '_task_ids[0]');
|
|
|
|
|
|
// $this->check($features[0]->id . '_task_ids[1]');
|
|
|
|
|
|
// $this->check($features[0]->id . '_task_ids[2]');
|
|
|
|
|
|
// $this->check($features[1]->id . '_task_ids[0]');
|
|
|
|
|
|
// $this->check($features[1]->id . '_task_ids[1]');
|
|
|
|
|
|
// $this->check($features[1]->id . '_task_ids[2]');
|
|
|
|
|
|
|
|
|
// $this->check($features[0]->id.'_task_ids[0]');
|
|
|
|
|
|
// $this->check($features[0]->id.'_task_ids[1]');
|
|
|
|
|
|
// $this->check($features[0]->id.'_task_ids[2]');
|
|
|
|
|
|
// $this->check($features[1]->id.'_task_ids[0]');
|
|
|
|
|
|
// $this->check($features[1]->id.'_task_ids[1]');
|
|
|
|
|
|
// $this->check($features[1]->id.'_task_ids[2]');
|
|
|
// $this->press(trans('feature.create'));
|
|
|
// $this->press(trans('feature.create'));
|
|
|
|
|
|
|
|
|
$form = $this->getForm(trans('feature.create')); |
|
|
$form = $this->getForm(trans('feature.create')); |
|
|
$form['feature_ids'][$features[0]->id]->tick(); |
|
|
$form['feature_ids'][$features[0]->id]->tick(); |
|
|
$form['feature_ids'][$features[1]->id]->tick(); |
|
|
$form['feature_ids'][$features[1]->id]->tick(); |
|
|
$form[$features[0]->id . '_task_ids'][$tasks1[0]->id]->tick(); |
|
|
|
|
|
$form[$features[0]->id . '_task_ids'][$tasks1[1]->id]->tick(); |
|
|
|
|
|
$form[$features[0]->id . '_task_ids'][$tasks1[2]->id]->tick(); |
|
|
|
|
|
$form[$features[1]->id . '_task_ids'][$tasks2[0]->id]->tick(); |
|
|
|
|
|
$form[$features[1]->id . '_task_ids'][$tasks2[1]->id]->tick(); |
|
|
|
|
|
$form[$features[1]->id . '_task_ids'][$tasks2[2]->id]->tick(); |
|
|
|
|
|
|
|
|
$form[$features[0]->id.'_task_ids'][$tasks1[0]->id]->tick(); |
|
|
|
|
|
$form[$features[0]->id.'_task_ids'][$tasks1[1]->id]->tick(); |
|
|
|
|
|
$form[$features[0]->id.'_task_ids'][$tasks1[2]->id]->tick(); |
|
|
|
|
|
$form[$features[1]->id.'_task_ids'][$tasks2[0]->id]->tick(); |
|
|
|
|
|
$form[$features[1]->id.'_task_ids'][$tasks2[1]->id]->tick(); |
|
|
|
|
|
$form[$features[1]->id.'_task_ids'][$tasks2[2]->id]->tick(); |
|
|
$this->makeRequestUsingForm($form); |
|
|
$this->makeRequestUsingForm($form); |
|
|
|
|
|
|
|
|
$this->seePageIs('projects/' . $projects[1]->id . '/features'); |
|
|
|
|
|
|
|
|
$this->seePageIs('projects/'.$projects[1]->id.'/features'); |
|
|
$this->see(trans('feature.created_from_other_project')); |
|
|
$this->see(trans('feature.created_from_other_project')); |
|
|
$this->seeInDatabase('features', [ |
|
|
$this->seeInDatabase('features', [ |
|
|
'project_id' => $projects[1]->id, |
|
|
'project_id' => $projects[1]->id, |
|
|
@ -222,6 +222,5 @@ class ManageFeaturesTest extends TestCase |
|
|
|
|
|
|
|
|
$this->visit('features'); |
|
|
$this->visit('features'); |
|
|
$this->seePageIs('features'); |
|
|
$this->seePageIs('features'); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |