Skip to content

Commit

Permalink
Fix #1008: Sourced conflicting holidays being imported by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tupaschoal authored and araujoarthur0 committed Oct 18, 2023
1 parent be6e066 commit e25523f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions __tests__/__renderer__/workday-waiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ describe('Test Workday Waiver Window', function()
const secondCell = table.find('td')[1].innerHTML;
const thirdCell = table.find('td')[2].innerHTML;
const fourthCell = table.find('td')[4].innerHTML;
const fourthCellContent = `<label class="switch"><input type="checkbox" checked="${conflicts || workingDay === 'No' ? '' : 'checked'}" name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
const fourthCellContent = `<label class="switch"><input type="checkbox" checked="" name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
expect(firstCell).toBe(day);
expect(secondCell).toBe(reason);
expect(thirdCell).toBe('undefined');
Expand All @@ -497,7 +497,7 @@ describe('Test Workday Waiver Window', function()
const secondCell = table.find('td')[1].innerHTML;
const thirdCell = table.find('td')[2].innerHTML;
const fourthCell = table.find('td')[4].innerHTML;
const fourthCellContent = `<label class="switch"><input type="checkbox" checked="${conflicts || workingDay === 'No' ? '' : 'checked'}" name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
const fourthCellContent = `<label class="switch"><input type="checkbox" name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
expect(firstCell).toBe(day);
expect(secondCell).toBe(reason);
expect(thirdCell).toBe(workingDay);
Expand All @@ -519,7 +519,7 @@ describe('Test Workday Waiver Window', function()
const thirdCell = table.find('td')[2].innerHTML;
const conflictsCell = table.find('td')[3].innerHTML;
const fourthCell = table.find('td')[4].innerHTML;
const fourthCellContent = `<label class="switch"><input type="checkbox" checked="${conflicts || workingDay === 'No' ? '' : 'checked'}" name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
const fourthCellContent = `<label class="switch"><input type="checkbox" name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
expect(firstCell).toBe(day);
expect(secondCell).toBe(reason);
expect(thirdCell).toBe(workingDay);
Expand Down
2 changes: 1 addition & 1 deletion src/workday-waiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function addHolidayToList(day, reason, workingDay, conflicts)
if (conflicts)
$(row.cells[3]).addClass('text-danger');
conflictsCell.innerHTML = conflicts;
importCell.innerHTML = `<label class="switch"><input type="checkbox" checked="${conflicts || workingDay === 'No' ? '' : 'checked'}" name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
importCell.innerHTML = `<label class="switch"><input type="checkbox" ${conflicts || workingDay === 'No' ? ' ' : 'checked=""'} name="import-${day}" id="import-${day}"><span class="slider round"></span></label>`;
}

function clearHolidayTable()
Expand Down

0 comments on commit e25523f

Please sign in to comment.