Choose Entry
-
+
Select
diff --git a/resources/views/tabulation/no_show_confirm.blade.php b/resources/views/tabulation/no_show_confirm.blade.php
new file mode 100644
index 0000000..95becb9
--- /dev/null
+++ b/resources/views/tabulation/no_show_confirm.blade.php
@@ -0,0 +1,19 @@
+
+
+ {{ $cardHeading }}
+
+
+ {{ $entry->student->full_name() }}
+ {{$entry->school->name}}
+
+
+ {{ $entry->audition->name }} #{{ $entry->draw_number ?? ' no draw number' }}
+
+
+
+
+ {{ $buttonName }}
+
+
+
+
diff --git a/routes/tabulation.php b/routes/tabulation.php
index b2523cf..c9d6e18 100644
--- a/routes/tabulation.php
+++ b/routes/tabulation.php
@@ -14,6 +14,13 @@ Route::middleware(['auth', 'verified', CheckIfCanTab::class])->group(function ()
Route::delete('/{score}', [\App\Http\Controllers\Tabulation\ScoreController::class, 'destroyScore'])->name('scores.destroy');
});
+ // Entry Flagging
+ Route::prefix('entry-flags/')->controller(\App\Http\Controllers\Tabulation\EntryFlagController::class)->group(function () {
+ Route::get('/choose_no_show', 'noShowSelect')->name('entry-flags.noShowSelect');
+ Route::get('/propose-no-show', 'noShowConfirm')->name('entry-flags.confirmNoShow');
+ Route::post('/no-show/{entry}', 'enterNoShow')->name('entry-flags.enterNoShow');
+ });
+
// Generic Tabulation Routes
Route::prefix('tabulation/')->controller(\App\Http\Controllers\Tabulation\TabulationController::class)->group(function () {
Route::get('/status', 'status')->name('tabulation.status');
diff --git a/tests/Feature/Pages/Tabulation/noShowConfirmTest.php b/tests/Feature/Pages/Tabulation/noShowConfirmTest.php
new file mode 100644
index 0000000..4bfb895
--- /dev/null
+++ b/tests/Feature/Pages/Tabulation/noShowConfirmTest.php
@@ -0,0 +1,66 @@
+create();
+ get(route('entry-flags.confirmNoShow', ['entry_id' => $entry->id]))
+ ->assertRedirect(route('home'));
+ actAsNormal();
+ get(route('entry-flags.confirmNoShow', ['entry_id' => $entry->id]))
+ ->assertRedirect(route('dashboard'))
+ ->assertSessionHas('error', 'You are not authorized to perform this action');
+ actAsTab();
+ get(route('entry-flags.confirmNoShow', ['entry_id' => $entry->id]))
+ ->assertOk();
+ actAsAdmin();
+ get(route('entry-flags.confirmNoShow', ['entry_id' => $entry->id]))
+ ->assertOk();
+});
+it('has information for the requested entry', function () {
+ // Arrange
+ $entry = Entry::factory()->create();
+ // Act & Assert
+ actAsTab();
+ get(route('entry-flags.confirmNoShow', ['entry_id' => $entry->id]))
+ ->assertOk()
+ ->assertSee($entry->student->full_name())
+ ->assertSee($entry->audition->name)
+ ->assertSee($entry->student->school->name)
+ ->assertSee($entry->draw_number);
+});
+it('posts to entry-flags.enterNoShow and has a submit button', function () {
+ // Arrange
+ $entry = Entry::factory()->create();
+ // Act & Assert
+ actAsTab();
+ get(route('entry-flags.confirmNoShow', ['entry_id' => $entry->id]))
+ ->assertOk()
+ ->assertFormExists('#no-show-confirmation-form', function (AssertForm $form) use ($entry) {
+ $form->hasMethod('POST')
+ ->hasAction(route('entry-flags.enterNoShow', ['entry' => $entry->id]))
+ ->contains('button', ['type' => 'submit'])
+ ->hasCSRF();
+ });
+});
+it('posts to entry-flags.undoNoShow and has a remove button if the entry is already a noshow', function () {
+ // Arrange
+ $entry = Entry::factory()->create();
+ $entry->addFlag('no_show');
+ // Act & Assert
+ actAsTab();
+ get(route('entry-flags.confirmNoShow', ['entry_id' => $entry->id]))
+ ->assertOk()
+ ->assertFormExists('#no-show-cancellation-form', function (AssertForm $form) use ($entry) {
+ $form->hasMethod('POST')
+ ->hasAction(route('entry-flags.undoNoShow', ['entry' => $entry->id]))
+ ->contains('button', ['type' => 'submit'])
+ ->hasCSRF();
+ });
+});
diff --git a/tests/Feature/Pages/Tabulation/noShowSelectTest.php b/tests/Feature/Pages/Tabulation/noShowSelectTest.php
new file mode 100644
index 0000000..e898ad8
--- /dev/null
+++ b/tests/Feature/Pages/Tabulation/noShowSelectTest.php
@@ -0,0 +1,41 @@
+assertRedirect(route('home'));
+ actAsAdmin();
+ get(route('entry-flags.noShowSelect'))
+ ->assertOk();
+ actAsTab();
+ get(route('entry-flags.noShowSelect'))
+ ->assertOk();
+ actAsNormal();
+ get(route('entry-flags.noShowSelect'))
+ ->assertRedirect(route('dashboard'))
+ ->assertSessionHas('error', 'You are not authorized to perform this action');
+});
+it('has an input for entry_id', function () {
+ actAsAdmin();
+ get(route('entry-flags.noShowSelect'))
+ ->assertOk()
+ ->assertElementExists('#entry_id', function (AssertElement $element) {
+ $element->is('input');
+ });
+});
+it('submits to entry-flags.confirmNoShow', function () {
+ actAsAdmin();
+ get(route('entry-flags.noShowSelect'))
+ ->assertOk()
+ ->assertFormExists('#entry-select-form', function (AssertForm $form) {
+ $form->hasMethod('GET')
+ ->hasAction(route('entry-flags.confirmNoShow'));
+ });
+});