diff --git a/src/components/pill/pill.spec.js b/src/components/pill/pill.spec.js index 3b8890595a..f3a0f87130 100644 --- a/src/components/pill/pill.spec.js +++ b/src/components/pill/pill.spec.js @@ -23,6 +23,17 @@ describe("Pill", () => { return renderer(My Text); }; + it("has required styles", () => { + const wrapper = render(); + + assertStyleMatch( + { + whiteSpace: "nowrap", + }, + wrapper + ); + }); + describe("when the children prop is passed to the component", () => { let instance, pill; beforeEach(() => { diff --git a/src/components/pill/pill.style.js b/src/components/pill/pill.style.js index 18abe1dbd3..74ffd500a7 100644 --- a/src/components/pill/pill.style.js +++ b/src/components/pill/pill.style.js @@ -68,6 +68,7 @@ const PillStyle = styled.span` justify-content: center; border: 2px solid ${pillColor}; height: auto; + white-space: nowrap; ${inFill && css`