Skip to content

Commit 962495c

Browse files
committed
Add some tests for plain CSS
1 parent 4458357 commit 962495c

File tree

5 files changed

+101
-0
lines changed

5 files changed

+101
-0
lines changed

test/integration/npm-package.test.js

+18
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ describe('style guide generated with npm package executable', function() {
5858
addJsonAssertions(output, variablesFile);
5959
});
6060

61+
describe('from plain CSS test project', function() {
62+
var output = path.join(testDir, 'css-test-output');
63+
64+
before(function(done) {
65+
this.timeout(30000);
66+
generateCssTestProjectStyleGuide(output).then(done).catch(done);
67+
});
68+
69+
checkCommonStructure(output);
70+
});
71+
6172
describe('from internal client files', function() {
6273
var output = path.join(testDir, 'demo-test-output');
6374
before(function(done) {
@@ -109,6 +120,13 @@ function generateLessTestProjectStyleGuide(output, variablesFile) {
109120
return generateStyleGuide(args);
110121
}
111122

123+
function generateCssTestProjectStyleGuide(output) {
124+
var args = getSharedConfig();
125+
args.kssSource = path.resolve(currentDir, '../projects/css-project/source/**/*.css');
126+
args.output = output;
127+
return generateStyleGuide(args);
128+
}
129+
112130
function generateDemoStyleGuide(output) {
113131
var args = getSharedConfig();
114132
args.kssSource = path.resolve(npmSgDir, 'lib/app/**/*.scss');

test/projects/css-project/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
output/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extraHead": [
3+
"<!-- extraHead comment -->"
4+
],
5+
"overviewPath": "test_overview.md",
6+
"commonClass": ["custom-class-1", "custom-class-2"],
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
/*
3+
First section
4+
5+
Markup:
6+
<div class="section">Section markup</div>
7+
8+
Styleguide 1.0
9+
*/
10+
11+
.section {
12+
color: #ff0000;
13+
}
14+
.section:hover {
15+
color: #00ff00;
16+
}
17+
.section:active {
18+
color: #0000ff;
19+
}
20+
21+
/*
22+
Section with modifiers
23+
24+
#ff0000 - Red test color
25+
#00ff00 - Green test color
26+
#0000ff - Blue test color
27+
.other-modifier - Other modifier
28+
29+
Markup:
30+
<div style="background: {$modifiers};"></div>
31+
32+
Styleguide 2.0
33+
*/
34+
35+
/*
36+
Section without markup
37+
38+
Styleguide 3.0
39+
*/
40+
41+
.test-css {color: purple;}
42+
43+
/*
44+
Section with multiple variables
45+
46+
Markup:
47+
<div class="section">Section markup</div>
48+
49+
Styleguide 4.0
50+
*/
51+
52+
.section1 {
53+
color: #ff0000;
54+
}
55+
56+
.section2 {
57+
background-color: #00ff00;
58+
}
59+
60+
.section3 {
61+
border: 1px solid #0000ff;
62+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Title1
2+
3+
Ut turkish, wings, sit to go barista half and half medium roast. Viennese sit, java, id trifecta doppio wings white ristretto coffee aged. Est con panna single shot, organic percolator that americano, bar single origin viennese black arabica. Espresso et a variety macchiato saucer skinny. Breve, froth, flavour grounds instant ut body sugar coffee.
4+
5+
<div class="foobar>Test code snippet</div>
6+
7+
## Title2
8+
9+
To go espresso organic bar extraction galão filter. Flavour barista mazagran mocha robusta, iced lungo coffee barista affogato. Con panna, sit aromatic so that frappuccino beans. Filter ut acerbic lungo java caramelization kopi-luwak a filter. Latte eu dripper, bar milk, body latte affogato aged froth.
10+
11+
### Title3
12+
13+
[Example link](http://example.com)

0 commit comments

Comments
 (0)