Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion elements/pfe-accordion/test/pfe-accordion_e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe(element, () => {
browser.setWindowSize(windowSize.width, windowSize.height);
});

if (!browser.capabilities.browserName === "IE") {
if (browser.capabilities.browserName !== "IE") {
["light", "dark", "saturated"].forEach(context => {
it(`should take a screenshot and compare for ${context} context`, () => {
if (context !== "light") {
Expand Down
2 changes: 1 addition & 1 deletion elements/pfe-clipboard/test/pfe-clipboard_e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ describe(element, () => {
});

it("should compare to the baseline", () => {
expect(browser.checkFullPageScreen(element)).toBeLessThan(1.25);
expect(browser.checkFullPageScreen(element)).toBeLessThan(1.55);
});
});
2 changes: 1 addition & 1 deletion elements/pfe-icon/test/pfe-icon_e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe(element, () => {
});

// @TODO: Currently test environment cannot handle dynamic nature of pfe-icon
if (!browser.capabilities.browserName === "IE") {
if (browser.capabilities.browserName !== "IE") {
it("should take a screenshot", () => {
browser.pause(5000);
browser.saveFullPageScreen(element);
Expand Down
3 changes: 3 additions & 0 deletions elements/pfe-modal/src/pfe-modal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Import polyfills: filter
import "./polyfills--pfe-modal.js";

import PFElement from "../../pfelement/dist/pfelement.js";

class PfeModal extends PFElement {
Expand Down
40 changes: 40 additions & 0 deletions elements/pfe-modal/src/polyfills--pfe-modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// @POLYFILL Array.prototype.filter
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
if (!Array.prototype.filter) {
Array.prototype.filter = function (func, thisArg) {
"use strict";
if (!((typeof func === "Function" || typeof func === "function") && this)) throw new TypeError();

var len = this.length >>> 0,
res = new Array(len), // preallocate array
t = this,
c = 0,
i = -1;

var kValue;
if (thisArg === undefined) {
while (++i !== len) {
// checks to see if the key was set
if (i in this) {
kValue = t[i]; // in case t is changed in callback
if (func(t[i], i, t)) {
res[c++] = kValue;
}
}
}
} else {
while (++i !== len) {
// checks to see if the key was set
if (i in this) {
kValue = t[i];
if (func.call(thisArg, t[i], i, t)) {
res[c++] = kValue;
}
}
}
}

res.length = c; // shrink down array to proper size
return res;
};
}
6 changes: 3 additions & 3 deletions elements/pfe-modal/test/pfe-modal_e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ describe(element, () => {
before(() => {
browser.url(`/elements/${element}/demo`);

browser.pause(1000);

browser.execute(function () {
window.scrollTo(0, 0);
document.querySelector("#first-modal").click();
Promise.all([customElements.whenDefined("pfe-modal")]).then(function () {
document.querySelector("#first-modal").click();
});
});

browser.pause(1000);
Expand Down
2 changes: 1 addition & 1 deletion elements/pfe-progress-steps/test/pfe-progress-steps_e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe(element, () => {


// There is no rendering experience for progress stepper in IE11
if (!browser.capabilities.browserName === "IE") {
if (browser.capabilities.browserName !== "IE") {
it("should take a screenshot", () => {
browser.saveFullPageScreen(element);
});
Expand Down
Loading