source: trip-planner-front/node_modules/postcss-attribute-case-insensitive/test/test.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import postcss from 'postcss';
2import { expect } from 'chai';
3
4import plugin from '..';
5
6const test = (input, output, opts, done) => {
7 postcss([
8 plugin(opts)
9 ])
10 .process(input, { from: '<inline>' })
11 .then(result => {
12 expect(result.css).to.eql(output);
13 expect(result.warnings()).to.be.empty; // eslint-disable-line no-unused-expressions
14
15 done();
16 })
17 .catch(done);
18};
19
20describe('postcss-attribute-case-insensitive', () => {
21 it('simple', done => {
22 test(
23 '[data-foo=test i] { display: block; }',
24 '[data-foo=test],[data-foo=Test],[data-foo=tEst],[data-foo=TEst],[data-foo=teSt],[data-foo=TeSt],[data-foo=tESt],[data-foo=TESt],[data-foo=tesT],[data-foo=TesT],[data-foo=tEsT],[data-foo=TEsT],[data-foo=teST],[data-foo=TeST],[data-foo=tEST],[data-foo=TEST] { display: block; }',
25 {},
26 done
27 );
28 });
29
30 it('with spaces', done => {
31 test(
32 '[foo="a b" i]{}',
33 '[foo="a b"],[foo="A b"],[foo="a B"],[foo="A B"]{}',
34 {},
35 done
36 );
37 });
38
39 it('not insensitive', done => {
40 test(
41 '[foo=a]{}',
42 '[foo=a]{}',
43 {},
44 done
45 );
46 });
47
48 it('several attributes', done => {
49 test(
50 '[foo=a i],[foobar=b],[bar=c i]{}',
51 '[foobar=b],[foo=a],[foo=A],[bar=c],[bar=C]{}',
52 {},
53 done
54 );
55 });
56});
Note: See TracBrowser for help on using the repository browser.