Skip to content

Commit e803cb8

Browse files
authored
Merge pull request #143 from outoftime/flex
Basic support for flexbox
2 parents 6aa0fd5 + 498c24b commit e803cb8

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

npm-shrinkwrap.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"bugs": "https://trello.com/b/ONaFg6wh/popcode",
3030
"license": "MIT",
3131
"dependencies": {
32-
"PrettyCSS": "^0.3.11",
32+
"PrettyCSS": "popcodeorg/PrettyCSS#v0.3.10-popcode.1",
3333
"base64-js": "^1.0.2",
3434
"bowser": "^1.4.1",
3535
"brace": "^0.8.0",
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* eslint-env mocha */
2+
3+
import '../../helper';
4+
import {
5+
assertPassesValidation,
6+
assertFailsValidationWith,
7+
} from '../../assertions/validations';
8+
9+
import css from '../../../src/validations/css';
10+
11+
function assertPassesCssValidation(source) {
12+
return assertPassesValidation(css, source);
13+
}
14+
15+
function assertFailsCssValidationWith(source, ...errors) {
16+
return assertFailsValidationWith(css, source, ...errors);
17+
}
18+
19+
describe('css', () => {
20+
it('allows valid flexbox', () =>
21+
assertPassesCssValidation(`
22+
.flex-container { display: flex; }
23+
.flex-item { flex: 1 0 auto; }
24+
`)
25+
);
26+
27+
it('fails with bogus flex value', () =>
28+
assertFailsCssValidationWith(
29+
'.flex-item { flex: bogus; }',
30+
'invalid-value'
31+
)
32+
);
33+
});
34+

0 commit comments

Comments
 (0)