Skip to content

Commit d5cf301

Browse files
committed
Add a style test for main-on-container text too
1 parent fcafc81 commit d5cf301

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/unit/styles.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ import { expect } from '../test-setup';
9999
);
100100
});
101101

102+
it("should have sufficient main-on-container text contrast", () => {
103+
const mainColor = theme.mainColor;
104+
const bgColor = theme.containerBackground;
105+
106+
const contrast = polished.getContrast(mainColor, bgColor);
107+
expect(contrast).to.be.greaterThan(normalContrastTarget,
108+
`Constrast for ${mainColor}/${bgColor} was only ${contrast}`
109+
);
110+
});
111+
102112
it("should have sufficient container watermark contrast", () => {
103113
const mainColor = theme.containerWatermark;
104114
const bgColor = theme.containerBackground;

0 commit comments

Comments
 (0)