Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Fix failing unit tests #17166

Closed
wants to merge 2 commits into from
Closed

Commits on Dec 9, 2021

  1. test(input): fix tests on Firefox v93+

    Since version 93, Firefox started more closely following the spec on
    formatting `datetime-local` input values by removing trailing zeros from
    the string representation of the value. This causes some of our tests to
    fail ([example failure][1]).
    
    For example, a value is reported by Firefox as `2009-01-06T16:25` while
    the tests expect `2009-01-06T16:25:00.000`. I.e. Firefox started leaving
    out seconds/milliseconds if they are zero.
    
    According to [MDN][2], this is the correct behavior according to the
    spec. Indeed the spec says that [if the value of the element is a valid
    local date and time string, then it must be set to a **valid normalized
    local date and time string**][3], where **valid normalized local date
    and time string** is [defined as consisting of][4]:
    > - A valid date string representing the date.
    > - A U+0054 LATIN CAPITAL LETTER T character (T).
    > - A valid time string representing the time, expressed as the
    >   **shortest possible string** for the given time (e.g. **omitting the
    >   seconds component** entirely if the given time is zero seconds past
    >   the minute).
    
    This commit fixes the relevant tests by explicitly specifying non-zero
    values for seconds and milliseconds.
    
    [1]: https://circleci.com/gh/angular/angular.js/3527
    [2]: https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats
      #local_date_and_time_strings
    [3]: https://html.spec.whatwg.org/multipage/input.html
      #local-date-and-time-state-(type=datetime-local)
    [4]: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html
      #concept-datetime-local
    
    Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>
    Ed Clement and gkalpak committed Dec 9, 2021
    Copy the full SHA
    1fddd5c View commit details
    Browse the repository at this point in the history
  2. test(Angular): fix angularInit() tests on Safari v15+

    Previously, the `angularInit()` tests assumed that the Safari browser
    uses the `safari-extension:` protocol for browser extension URLs. This
    is true for versions <15. However, since v15, Safari on iOS only
    recognizes the `chrome-extension:` protocol, which causes the tests to
    fail ([example failure][1]).
    
    This commit updates the tests to use the correct protocol according to
    the version of Safari used.
    
    NOTE:
    On macOS, Safari v15+ recognizes both `safari-extension:` and
    `chrome-extension:`, so it is OK to always use the later with Safari
    v15+ (regardless of the platform).
    
    [1]: https://circleci.com/gh/angular/angular.js/3527
    
    Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>
    Ed Clement and gkalpak committed Dec 9, 2021
    Copy the full SHA
    ca0a166 View commit details
    Browse the repository at this point in the history