Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable CSS-in-JS tests #6556

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
126 changes: 62 additions & 64 deletions lib/rules/color-hex-case/__tests__/index.js
Expand Up @@ -166,68 +166,67 @@ testRule(
);

testRule({
skip: true,
ruleName,
config: ['lower'],
customSyntax: 'postcss-css-in-js',
customSyntax: 'postcss-styled-syntax',
fix: true,
accept: [
{
code: `
export const s = styled.a({
color: "#aaa",
});
export const s = styled.a\`
color: #aaa;
\`;
`,
},
{
code: `
export const s = styled.a({
stroke: "url(#AAA)",
});
export const s = styled.a\`
stroke: url(#AAA);
\`;
`,
description: 'href with location',
},
{
code: `
export const s = styled.a({
color: "PINK",
});
export const s = styled.a\`
color: PINK;
\`;
`,
},
{
code: `
export const s = styled.a({
background: "linear-gradient(#aaa, #ffff, #0000ffcc)",
});
export const s = styled.a\`
background: linear-gradient(#aaa, #ffff, #0000ffcc);
\`;
`,
},
{
code: `
export const s = styled("a::before")({
content: '"#ABABAB"',
});
export const s = styled.a\`
content: "#ABABAB";
\`;
`,
},
{
code: `
export const s = styled.a({
color: "white /* #FFF */",
});
export const s = styled.a\`
color: white /* #FFF */;
\`;
`,
},
],

reject: [
{
code: `
export const s = styled.a({
color: "#aBABAA",
});
export const s = styled.a\`
color: #aBABAA;
\`;
`,
fixed: `
export const s = styled.a({
color: "#ababaa",
});
export const s = styled.a\`
color: #ababaa;
\`;
`,

message: messages.expected('#aBABAA', '#ababaa'),
Expand All @@ -236,14 +235,14 @@ testRule({
},
{
code: `
export const s = styled.a({
background: "linear-gradient(#AAA, #FaFa, #0000FFcc)",
});
export const s = styled.a\`
background: linear-gradient(#AAA, #FaFa, #0000FFcc);
\`;
`,
fixed: `
export const s = styled.a({
background: "linear-gradient(#aaa, #fafa, #0000ffcc)",
});
export const s = styled.a\`
background: linear-gradient(#aaa, #fafa, #0000ffcc);
\`;
`,

warnings: [
Expand All @@ -256,68 +255,67 @@ testRule({
});

testRule({
skip: true,
ruleName,
config: ['upper'],
customSyntax: 'postcss-css-in-js',
customSyntax: 'postcss-styled-syntax',
fix: true,
accept: [
{
code: `
export const s = styled.a({
color: "#AAA",
});
export const s = styled.a\`
color: #AAA;
\`;
`,
},
{
code: `
export const s = styled.a({
stroke: "url(#aaa)",
});
export const s = styled.a\`
stroke: url(#aaa);
\`;
`,
description: 'href with location',
},
{
code: `
export const s = styled.a({
color: "pink",
});
export const s = styled.a\`
color: pink;
\`;
`,
},
{
code: `
export const s = styled.a({
background: "linear-gradient(#AAA, #FFFF, #0000FFCC)",
});
export const s = styled.a\`
background: linear-gradient(#AAA, #FFFF, #0000FFCC);
\`;
`,
},
{
code: `
export const s = styled("a::before")({
content: '"#ababab"',
});
export const s = styled.a\`
content: "#ababab";
\`;
`,
},
{
code: `
export const s = styled.a({
color: "white /* #fff */",
});
export const s = styled.a\`
color: white /* #fff */;
\`;
`,
},
],

reject: [
{
code: `
export const s = styled.a({
color: "#aBABAB",
});
export const s = styled.a\`
color: #aBABAB;
\`;
`,
fixed: `
export const s = styled.a({
color: "#ABABAB",
});
export const s = styled.a\`
color: #ABABAB;
\`;
`,

message: messages.expected('#aBABAB', '#ABABAB'),
Expand All @@ -326,14 +324,14 @@ testRule({
},
{
code: `
export const s = styled.a({
background: "linear-gradient(#aaa, #FaFa, #0000FFcc)",
});
export const s = styled.a\`
background: linear-gradient(#aaa, #FaFa, #0000FFcc);
\`;
`,
fixed: `
export const s = styled.a({
background: "linear-gradient(#AAA, #FAFA, #0000FFCC)",
});
export const s = styled.a\`
background: linear-gradient(#AAA, #FAFA, #0000FFCC);
\`;
`,

warnings: [
Expand Down