Kanban / timesheet update
This commit is contained in:
@@ -35,14 +35,15 @@ it('has no accessibility issues on the time pages and no sideways scrolling', fu
|
||||
|
||||
it('records hours in the weekly view with the keyboard', function () {
|
||||
$tuesday = now()->startOfWeek()->addDay()->toDateString();
|
||||
$cell = '#cell-'.$this->task->id.'-'.$tuesday;
|
||||
$cell = '#cell-scheduled-'.$this->task->id.'-'.$tuesday;
|
||||
|
||||
visit(route('time.week'))
|
||||
->on()->desktop()
|
||||
->type($cell, '2,5')
|
||||
->clear($cell)
|
||||
->type($cell, '2:30')
|
||||
->keys($cell, 'Tab')
|
||||
->assertSee('Tallennettu: Mainoskuvat')
|
||||
->assertSee('Viikko yhteensä: 4 h')
|
||||
->assertSee('Viikko yhteensä: 4:00 h')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
|
||||
expect((float) TimeEntryModel::query()->whereDate('worked_on', $tuesday)->sole()->hours)->toBe(2.5);
|
||||
@@ -50,8 +51,8 @@ it('records hours in the weekly view with the keyboard', function () {
|
||||
|
||||
it('shows an invalid value as an error at the field', function (string $device) {
|
||||
$selector = $device === 'mobile'
|
||||
? '#mcell-'.$this->task->id.'-'.$this->monday
|
||||
: '#cell-'.$this->task->id.'-'.$this->monday;
|
||||
? '#mcell-scheduled-'.$this->task->id.'-'.$this->monday
|
||||
: '#cell-scheduled-'.$this->task->id.'-'.$this->monday;
|
||||
|
||||
$visit = visit(route('time.week'));
|
||||
$visit = $device === 'mobile' ? $visit->on()->mobile() : $visit->on()->desktop();
|
||||
@@ -90,7 +91,7 @@ it('has no accessibility issues on the approval pages', function (string $page,
|
||||
$visit = $device === 'mobile' ? $visit->on()->mobile() : $visit->on()->desktop();
|
||||
$visit = $colorScheme === 'dark' ? $visit->inDarkMode() : $visit->inLightMode();
|
||||
|
||||
$visit->assertSee($page === 'approvals' ? 'Kaisa Kollega' : 'hyväksytty')
|
||||
$visit->assertSee($page === 'approvals' ? 'Kaisa Kollega' : 'Hyväksytty:')
|
||||
->assertScript('document.documentElement.scrollWidth <= window.innerWidth', true)
|
||||
->assertNoJavaScriptErrors()
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
@@ -103,11 +104,51 @@ it('has no accessibility issues on the approval pages', function (string $page,
|
||||
|
||||
it('approves the own week with the keyboard and shows the cells as approved', function () {
|
||||
visit(route('time.week'))
|
||||
->assertSee('Hyväksymättä 1,5 h.')
|
||||
->keys('#approval-heading + p + div button', 'Enter')
|
||||
->assertSee('Hyväksymättä:')
|
||||
->assertSee('1:30')
|
||||
->click('Hyväksy viikko')
|
||||
->assertSee('Hyväksytyt tunnit on lukittu.')
|
||||
->assertSee('hyväksytty')
|
||||
->assertSee('Hyväksytty:')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
|
||||
expect(TimeEntryModel::query()->sole()->approved_at)->not->toBeNull();
|
||||
});
|
||||
|
||||
it('asks for the missing billing notes before approving, and fills one in the entry dialog', function () {
|
||||
TimeEntryModel::query()->update(['note' => null]);
|
||||
|
||||
visit(route('time.week'))
|
||||
->on()->desktop()
|
||||
->assertSee('1 selite puuttuu')
|
||||
->click('Hyväksy viikko')
|
||||
->assertScript('document.getElementById("missing-notes-dialog").open', true)
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->click('#missing-notes-dialog button[wire\\:click^="openEntry"]')
|
||||
->assertScript('document.getElementById("entry-dialog").open', true)
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->type('#entry-note', 'Mainoskuvien luonnokset')
|
||||
->keys('#entry-note', 'Escape')
|
||||
->assertSee('Kirjaus tallennettu')
|
||||
->assertScript('document.getElementById("entry-dialog").open', false);
|
||||
|
||||
expect(TimeEntryModel::query()->sole()->note)->toBe('Mainoskuvien luonnokset');
|
||||
});
|
||||
|
||||
it('has no accessibility issues in the timer, work orders and add to list dialogs', function (string $colorScheme) {
|
||||
$visit = visit(route('time.week'))->on()->desktop();
|
||||
$visit = $colorScheme === 'dark' ? $visit->inDarkMode() : $visit->inLightMode();
|
||||
|
||||
$visit->click('[aria-label^="Työajastin: Mainoskuvat"]')
|
||||
->assertScript('document.getElementById("timer-dialog").open', true)
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->keys('#timer-note', 'Escape')
|
||||
->click('#open-manage')
|
||||
->assertScript('document.getElementById("manage-dialog").open', true)
|
||||
->assertNoAccessibilityIssues(level: 2)
|
||||
->keys('#manage-dialog', 'Escape')
|
||||
->click('#open-add-to-list')
|
||||
->assertScript('document.getElementById("add-to-list-dialog").open', true)
|
||||
->type('#pin-search', 'Mainos')
|
||||
->assertSee('1 osuma')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
})->with(['light', 'dark']);
|
||||
|
||||
Reference in New Issue
Block a user