[mozmill] testTodayPane failing on single digit months and days

RESOLVED FIXED in 5.5

Status

defect
--
major
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Taraman, Assigned: Taraman)

Tracking

(Blocks 1 bug)

unspecified
Dependency tree / graph

Details

Attachments

(1 attachment)

Assignee

Description

3 years ago
The function getIsoDate does not take into account for padding 0 before single digit months and days.
e.g. on 2017-01-01 the returned string is 201711
Assignee

Comment 1

3 years ago
Posted patch Ptach V1.0Splinter Review
Padding zeros does the trick.
Assignee: nobody → Mozilla
Status: NEW → ASSIGNED
Attachment #8823031 - Flags: review?(makemyday)
Assignee

Updated

3 years ago
Blocks: 983787

Comment 2

3 years ago
Comment on attachment 8823031 [details] [diff] [review]
Ptach V1.0

Review of attachment 8823031 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for coming up with a fix quickly. r+ with the below comments considered.

::: calendar/test/mozmill/testTodayPane.js
@@ +270,4 @@
>      let soon = lookup(`
>          /id("messengerWindow")/id("tabmail-container")/id("today-pane-panel")/
>          [1]/id("agenda-panel")/{"flex":"1"}/id("agenda-listbox")/[2]/
> +        anon({"class":"agenda-checkbox"})                                                               

Whitespaces

@@ +287,5 @@
> +    function padToTwo(n) {
> +        return n < 10 ? `0${n}` : `${n}`;
> +    }
> +    let month = padToTwo(currDate.getMonth() + 1);
> +    let day = padToTwo(currDate.getDate());

If you define nested functions, put the inner declaration to the top of the outer or assign the inner to a variable instead to avoid strict mode errors. However, here you can use directly

let month = currDate.getMonth() + 1).toString().padStart(2, "0");
let day = currDate.getDate().toString().padStart(2, "0");
Attachment #8823031 - Flags: review?(makemyday) → review+
Assignee

Comment 3

3 years ago
with the comments fixed
pushed to -> https://hg.mozilla.org/comm-central/rev/2e479125e5d9
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 5.5
Assignee

Comment 4

3 years ago
We have one failure on comm-central in this test after the push.

> 15:51:44     INFO -  SUMMARY-UNEXPECTED-FAIL | testTodayPane.js | testTodayPane.js::testTodayPane
> 15:51:44     INFO -    EXCEPTION: waitFor: Timeout exceeded for '() => {
> 15:51:44     INFO -          return iframe.contentWindow.onLoad &&
> 15:51:44     INFO -                 iframe.contentWindow.onLoad.hasLoaded == true;
> 15:51:44 INFO - }'

This is due to the event dialog not opening in time and not related to this issue.
You need to log in before you can comment on or make changes to this bug.