Skip to content

Commit

Permalink
Adding test for postcss#1333 (preventing warnings when grid is turned…
Browse files Browse the repository at this point in the history
… off)
  • Loading branch information
Daniel Tonon committed Jul 11, 2020
1 parent 7986932 commit af115f0
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 19 deletions.
38 changes: 19 additions & 19 deletions test/autoprefixer.test.js
Expand Up @@ -694,41 +694,41 @@ describe('hacks', () => {
'without grid-template-columns',
'autoprefixer: <css input>:39:3: Can not find grid areas: ' +
'head, nav, main, foot',
'autoprefixer: <css input>:47:3: Can not implement grid-gap ' +
'autoprefixer: <css input>:57:3: Can not implement grid-gap ' +
'without grid-template-columns',
'autoprefixer: <css input>:47:3: Can not find grid areas: a',
'autoprefixer: <css input>:55:3: Can not implement grid-gap ' +
'autoprefixer: <css input>:57:3: Can not find grid areas: a',
'autoprefixer: <css input>:65:3: Can not implement grid-gap ' +
'without grid-template-columns',
'autoprefixer: <css input>:55:3: Can not find grid areas: b',
'autoprefixer: <css input>:63:3: Can not find grid areas: c',
'autoprefixer: <css input>:71:3: Can not find grid areas: d',
'autoprefixer: <css input>:99:3: grid-column-span is not part ' +
'autoprefixer: <css input>:65:3: Can not find grid areas: b',
'autoprefixer: <css input>:73:3: Can not find grid areas: c',
'autoprefixer: <css input>:81:3: Can not find grid areas: d',
'autoprefixer: <css input>:109:3: grid-column-span is not part ' +
'of final Grid Layout. Use grid-column.',
'autoprefixer: <css input>:100:3: grid-row-span is not part ' +
'autoprefixer: <css input>:110:3: grid-row-span is not part ' +
'of final Grid Layout. Use grid-row.',
'autoprefixer: <css input>:101:3: grid-auto-columns is not ' +
'autoprefixer: <css input>:111:3: grid-auto-columns is not ' +
'supported by IE',
'autoprefixer: <css input>:102:3: grid-auto-rows is not ' +
'autoprefixer: <css input>:112:3: grid-auto-rows is not ' +
'supported by IE',
'autoprefixer: <css input>:104:33: auto-fill value is not ' +
'autoprefixer: <css input>:114:33: auto-fill value is not ' +
'supported by IE',
'autoprefixer: <css input>:105:30: auto-fit value is not ' +
'autoprefixer: <css input>:115:30: auto-fit value is not ' +
'supported by IE',
'autoprefixer: <css input>:121:3: Please do not use ' +
'autoprefixer: <css input>:131:3: Please do not use ' +
'display: contents; if you have grid setting enabled',
'autoprefixer: <css input>:125:3: IE does not support align-items ' +
'autoprefixer: <css input>:135:3: IE does not support align-items ' +
'on grid containers. Try using align-self on child elements instead: ' +
'.warn_ie_align > * { align-self: center }',
'autoprefixer: <css input>:130:3: IE does not support justify-items ' +
'autoprefixer: <css input>:140:3: IE does not support justify-items ' +
'on grid containers. Try using justify-self on child elements ' +
'instead: .warn_ie_justify > * { justify-self: center }',
'autoprefixer: <css input>:135:3: IE does not support justify-content ' +
'autoprefixer: <css input>:145:3: IE does not support justify-content ' +
'on grid containers',
'autoprefixer: <css input>:140:3: IE does not support place-items ' +
'autoprefixer: <css input>:150:3: IE does not support place-items ' +
'on grid containers. Try using place-self on child elements ' +
'instead: .warn_place_items > * { place-self: start end }',
'autoprefixer: <css input>:164:3: grid-auto-flow is not supported by IE',
'autoprefixer: <css input>:186:26: Autoprefixer currently does not ' +
'autoprefixer: <css input>:174:3: grid-auto-flow is not supported by IE',
'autoprefixer: <css input>:196:26: Autoprefixer currently does not ' +
'support line names. Try using grid-template-areas instead.'
])

Expand Down
10 changes: 10 additions & 0 deletions test/cases/grid.css
Expand Up @@ -41,6 +41,16 @@
"foot ....";
}

.no-warn {
/* autoprefixer grid: off */
grid-column-end: 3;
grid: subgrid;
grid-gap: 1rem;
grid-template-areas: "head head"
"nav main"
"foot ....";
}

.warn-gap-rows {
grid-gap: 1rem;
grid-template-rows: 1fr 1fr;
Expand Down
10 changes: 10 additions & 0 deletions test/cases/grid.disabled.css
Expand Up @@ -41,6 +41,16 @@
"foot ....";
}

.no-warn {
/* autoprefixer grid: off */
grid-column-end: 3;
grid: subgrid;
grid-gap: 1rem;
grid-template-areas: "head head"
"nav main"
"foot ....";
}

.warn-gap-rows {
grid-gap: 1rem;
grid-template-rows: 1fr 1fr;
Expand Down
10 changes: 10 additions & 0 deletions test/cases/grid.out.css
Expand Up @@ -64,6 +64,16 @@
"foot ....";
}

.no-warn {
/* autoprefixer grid: off */
grid-column-end: 3;
grid: subgrid;
grid-gap: 1rem;
grid-template-areas: "head head"
"nav main"
"foot ....";
}

.warn-gap-rows {
grid-gap: 1rem;
-ms-grid-rows: 1fr 1rem 1fr;
Expand Down

0 comments on commit af115f0

Please sign in to comment.