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

test(support): verify support tests results in all tested browsers #16008

Merged
merged 1 commit into from
May 25, 2017

Conversation

mgol
Copy link
Member

@mgol mgol commented May 24, 2017

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

New tests.

What is the current behavior? (You can also link to an open issue here)

It's not tested whether browsers pass or fail specific support tests used to skip particular test blocks.

What is the new behavior (if this is a feature change)?

All browsers have verified support tests results.

Does this PR introduce a breaking change?

No.

Please check if the PR fulfills these requirements

Other information:

Sorry, something went wrong.

@mgol mgol force-pushed the support-tests-verification branch from f6d970a to 6916651 Compare May 24, 2017 14:16
@@ -0,0 +1,91 @@
'use strict';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect this file to be in test/helpers/. Why here? It is confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why in test/helpers? test/helpers/ contains helpers for tests, not actual tests.

Copy link
Member

@gkalpak gkalpak May 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It contains helpers for tests and their tests (when they exist) 😃
For lack of a better directory, keeping the spec file next to the source is better than putting it into an arbitrary directory 😛

// Support: iOS 8 only
if (/iPhone OS 10_1\d(?:_\d+)? /.test(userAgent)) {
// iOS 8 official simulators have broken user agent (containing something like `iPhone OS 10_12_5`,
// i.e. the macOS version in place of the iOS version so they'd fall into an incorrect bucket.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing ).

// i.e. the macOS version in place of the iOS version so they'd fall into an incorrect bucket.
// Fix the user agent there.
// NOTE: Make sure the above check doesn't catch the real iOS 10!
userAgent = userAgent.replace(/iPhone OS 10(?:_\d)+/, 'iPhone OS 8_1');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_\d --> _\d+

userAgent = userAgent.replace(/iPhone OS 10(?:_\d)+/, 'iPhone OS 8_1');
}

if (/edge\//i.test(userAgent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not convert userAgent to lowercase once and avoid all the i flags? 😃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would have to be lowerCasedUserAgent to be precise. And maybe we'll need case sensitivity one day?

fatArrows: true,
shorthandMethods: true
};
} else if (/(?:msie|trident)/i.test(userAgent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/(?:msie|trident)/ --> /msie|trident/

fatArrows: true,
shorthandMethods: true
};
} else if (/\b9\.\d+(\.\d+)* safari/i.test(userAgent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/\b9\.\d+(\.\d+)* --> /\b9(?:\.\d+)+

fatArrows: false,
shorthandMethods: true
};
} else if (/\b\d+\.\d+(\.\d+)* safari/i.test(userAgent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/\b\d+\.\d+(\.\d+)* --> /\b\d+(?:\.\d+)+

fatArrows: true,
shorthandMethods: true
};
} else if (/android 4\.[0-3]/i.test(userAgent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break when Android 4.10 is out 😛

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android 4.x is dead, we're safe. :)

@mgol mgol force-pushed the support-tests-verification branch from 2ba18e0 to 492cb35 Compare May 24, 2017 17:36
@mgol
Copy link
Member Author

mgol commented May 24, 2017

@gkalpak PR updated, tests now pass.

@gkalpak
Copy link
Member

gkalpak commented May 24, 2017

Why did tests previously fail?
LGTM except for supportSpec being in test/ng/ (instead of test/helpers/), as is privateMocksSpec.js for example.

@mgol mgol force-pushed the support-tests-verification branch from 492cb35 to de30421 Compare May 25, 2017 07:31
@mgol
Copy link
Member Author

mgol commented May 25, 2017

The spec file moved (I missed privateMocksSpec.js previously).

The tests were failing as I didn't add results for Safari 8 so it was treated the same as Safari 10. :-)

@mgol mgol merged commit b4651e5 into angular:master May 25, 2017
@mgol mgol deleted the support-tests-verification branch May 25, 2017 14:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants