Skip to content

Commit

Permalink
fix: test that issue #763 has been fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdeansanchez committed Apr 14, 2021
1 parent 992372b commit 08039c7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/integration/react-imgix.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,33 @@ describe("Background Mode", () => {
});
});

describe("when both w and h provided", () => {
it("does not duplicate query params for height and width", () => {
const sut = renderIntoContainer(
<Background
src="https://assets.imgix.net/examples/pione.jpg"
imgixParams={{
w: 300,
h: 350,
}}
className="bg-img"
></Background>
);

const bgImageSrcURL = findURIfromSUT(sut);
const seen = new Set();
for (const [k, _v] of bgImageSrcURL.queryPairs) {
if (seen.has(k)) {
throw new Error(
`duplicate keys for '${k}' found in query parameters`
);
} else {
seen.add(k);
}
}
});
});

describe("without the backgroundSize prop set", () => {
beforeEach(async () => {
sut = await renderBGAndWaitUntilLoaded(
Expand Down

0 comments on commit 08039c7

Please sign in to comment.