Skip to content

Commit

Permalink
removes sandbox to make tests pass on chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliaspit committed Sep 23, 2020
1 parent a7313c5 commit 074fb49
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion karma.conf.ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (config) {
customLaunchers: {
Chrome_CI: {
base: "Chrome",
flags: ["--no-sandbox"]
flags: []
}
},
browsers: ["Chrome_CI"]
Expand Down
44 changes: 22 additions & 22 deletions test/Bling.spec.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/* eslint-disable react/no-multi-comp */
import React, { Component } from "react";
import React, {Component} from "react";
import PropTypes from "prop-types";
import ReactTestUtils from "react-dom/test-utils";
import ShallowRenderer from "react-test-renderer/shallow";
import Bling from "../src/Bling";
import Events from "../src/Events";
import { pubadsAPI, APIToCallBeforeServiceEnabled } from "../src/createManager";
import { gptVersion, pubadsVersion } from "../src/utils/apiList";
import { createManagerTest } from "../src/utils/createManagerTest";
import {pubadsAPI, APIToCallBeforeServiceEnabled} from "../src/createManager";
import {gptVersion, pubadsVersion} from "../src/utils/apiList";
import {createManagerTest} from "../src/utils/createManagerTest";

describe("Bling", () => {
let googletag;
const stubs = [];

beforeEach(() => {
Bling.configure({ renderWhenViewable: false });
Bling.configure({renderWhenViewable: false});
Bling.testManager = createManagerTest();
googletag = Bling._adManager.googletag;
});
Expand Down Expand Up @@ -43,7 +43,7 @@ describe("Bling", () => {
);
const result = renderer.getRenderOutput();
expect(result.type).to.equal("div");
expect(result.props.style).to.eql({ width: 728, height: 90 });
expect(result.props.style).to.eql({width: 728, height: 90});
});

it("renders fluid to auto width and height", () => {
Expand All @@ -53,7 +53,7 @@ describe("Bling", () => {
);
const result = renderer.getRenderOutput();
expect(result.type).to.equal("div");
expect(result.props.style).to.eql({ width: "auto", height: "auto" });
expect(result.props.style).to.eql({width: "auto", height: "auto"});
});

it("renders ['fluid'] to auto width and height", () => {
Expand All @@ -63,7 +63,7 @@ describe("Bling", () => {
);
const result = renderer.getRenderOutput();
expect(result.type).to.equal("div");
expect(result.props.style).to.eql({ width: "auto", height: "auto" });
expect(result.props.style).to.eql({width: "auto", height: "auto"});
});

it("returns gpt version", done => {
Expand Down Expand Up @@ -298,7 +298,7 @@ describe("Bling", () => {

it("calls getServices on adSlot on clear", () => {
const instance = new Bling();
const adSlot = sinon.mock({ getServices: () => {} });
const adSlot = sinon.mock({getServices: () => {}});
adSlot.expects("getServices").once();
instance._adSlot = adSlot;
instance.clear();
Expand Down Expand Up @@ -355,16 +355,16 @@ describe("Bling", () => {
<Bling
adUnitPath="/4595/nfl.test.open"
sizeMapping={[
{ viewport: [0, 0], slot: [320, 50] },
{ viewport: [750, 200], slot: [728, 90] },
{ viewport: [1050, 200], slot: [1024, 120] }
{viewport: [0, 0], slot: [320, 50]},
{viewport: [750, 200], slot: [728, 90]},
{viewport: [1050, 200], slot: [1024, 120]}
]}
/>
);
});

it("reflects targeting props to adSlot", done => {
const targeting = { t1: "v1", t2: [1, 2, 3] };
const targeting = {t1: "v1", t2: [1, 2, 3]};

Bling.once(Events.RENDER, () => {
const adSlot = instance.adSlot;
Expand Down Expand Up @@ -431,7 +431,7 @@ describe("Bling", () => {
const instance = ReactTestUtils.renderIntoDocument(
<Bling
adUnitPath="/4595/nfl.test.open"
attributes={{ attr1: "val1", attr2: "val2" }}
attributes={{attr1: "val1", attr2: "val2"}}
slotSize={[300, 250]}
/>
);
Expand Down Expand Up @@ -641,7 +641,7 @@ describe("Bling", () => {
);
const result = renderer.getRenderOutput();
expect(result.type).to.equal("div");
expect(result.props.style).to.eql({ width: 300, height: 250 });
expect(result.props.style).to.eql({width: 300, height: 250});
});

it("sets slotSize to 0,0 on foldCheck of 'fluid' or ['fluid']", done => {
Expand Down Expand Up @@ -674,13 +674,13 @@ describe("Bling", () => {

class Wrapper extends Component {
state = {
targeting: { prop: "val" }
targeting: {prop: "val"}
};
onSlotRenderEnded = event => {
if (count === 0) {
expect(event.slot.getTargeting("prop")).to.equal("val");
this.setState({
targeting: { prop: "val2" }
targeting: {prop: "val2"}
});
count++;
} else {
Expand All @@ -689,7 +689,7 @@ describe("Bling", () => {
}
};
render() {
const { targeting } = this.state;
const {targeting} = this.state;
return (
<Bling
adUnitPath="/4595/nfl.test.open"
Expand All @@ -711,13 +711,13 @@ describe("Bling", () => {

class Wrapper extends Component {
state = {
targeting: { prop: "val" }
targeting: {prop: "val"}
};
onSlotRenderEnded = event => {
if (count === 0) {
expect(event.slot.getTargeting("prop")).to.equal("val");
this.setState({
targeting: { prop: "val2" }
targeting: {prop: "val2"}
});
count++;
} else {
Expand All @@ -726,7 +726,7 @@ describe("Bling", () => {
}
};
render() {
const { targeting } = this.state;
const {targeting} = this.state;
return (
<Bling
adUnitPath="/4595/nfl.test.open"
Expand Down Expand Up @@ -767,7 +767,7 @@ describe("Bling", () => {
}
};
render() {
const { adUnitPath } = this.state;
const {adUnitPath} = this.state;
return (
<Bling
adUnitPath={adUnitPath}
Expand Down

0 comments on commit 074fb49

Please sign in to comment.