From 962495c858a785112bbf287d6f02b44fc12cf1bc Mon Sep 17 00:00:00 2001 From: Toni Ruottu Date: Fri, 20 Mar 2015 13:29:16 +0200 Subject: [PATCH 1/2] Add some tests for plain CSS --- test/integration/npm-package.test.js | 18 ++++++ test/projects/css-project/.gitignore | 1 + .../css-project/source/styleguide_config.json | 7 +++ .../css-project/source/styles/style.css | 62 +++++++++++++++++++ .../css-project/source/test_overview.md | 13 ++++ 5 files changed, 101 insertions(+) create mode 100644 test/projects/css-project/.gitignore create mode 100644 test/projects/css-project/source/styleguide_config.json create mode 100644 test/projects/css-project/source/styles/style.css create mode 100644 test/projects/css-project/source/test_overview.md diff --git a/test/integration/npm-package.test.js b/test/integration/npm-package.test.js index fbd102ec..9b897c16 100644 --- a/test/integration/npm-package.test.js +++ b/test/integration/npm-package.test.js @@ -58,6 +58,17 @@ describe('style guide generated with npm package executable', function() { addJsonAssertions(output, variablesFile); }); + describe('from plain CSS test project', function() { + var output = path.join(testDir, 'css-test-output'); + + before(function(done) { + this.timeout(30000); + generateCssTestProjectStyleGuide(output).then(done).catch(done); + }); + + checkCommonStructure(output); + }); + describe('from internal client files', function() { var output = path.join(testDir, 'demo-test-output'); before(function(done) { @@ -109,6 +120,13 @@ function generateLessTestProjectStyleGuide(output, variablesFile) { return generateStyleGuide(args); } +function generateCssTestProjectStyleGuide(output) { + var args = getSharedConfig(); + args.kssSource = path.resolve(currentDir, '../projects/css-project/source/**/*.css'); + args.output = output; + return generateStyleGuide(args); +} + function generateDemoStyleGuide(output) { var args = getSharedConfig(); args.kssSource = path.resolve(npmSgDir, 'lib/app/**/*.scss'); diff --git a/test/projects/css-project/.gitignore b/test/projects/css-project/.gitignore new file mode 100644 index 00000000..ea1472ec --- /dev/null +++ b/test/projects/css-project/.gitignore @@ -0,0 +1 @@ +output/ diff --git a/test/projects/css-project/source/styleguide_config.json b/test/projects/css-project/source/styleguide_config.json new file mode 100644 index 00000000..3340f571 --- /dev/null +++ b/test/projects/css-project/source/styleguide_config.json @@ -0,0 +1,7 @@ +{ + "extraHead": [ + "" + ], + "overviewPath": "test_overview.md", + "commonClass": ["custom-class-1", "custom-class-2"], +} diff --git a/test/projects/css-project/source/styles/style.css b/test/projects/css-project/source/styles/style.css new file mode 100644 index 00000000..aa60d766 --- /dev/null +++ b/test/projects/css-project/source/styles/style.css @@ -0,0 +1,62 @@ + +/* +First section + +Markup: +
Section markup
+ +Styleguide 1.0 +*/ + +.section { + color: #ff0000; +} +.section:hover { + color: #00ff00; +} +.section:active { + color: #0000ff; +} + +/* +Section with modifiers + +#ff0000 - Red test color +#00ff00 - Green test color +#0000ff - Blue test color +.other-modifier - Other modifier + +Markup: +
+ +Styleguide 2.0 +*/ + +/* +Section without markup + +Styleguide 3.0 +*/ + +.test-css {color: purple;} + +/* +Section with multiple variables + +Markup: +
Section markup
+ +Styleguide 4.0 +*/ + +.section1 { + color: #ff0000; +} + +.section2 { + background-color: #00ff00; +} + +.section3 { + border: 1px solid #0000ff; +} diff --git a/test/projects/css-project/source/test_overview.md b/test/projects/css-project/source/test_overview.md new file mode 100644 index 00000000..25b6bfdf --- /dev/null +++ b/test/projects/css-project/source/test_overview.md @@ -0,0 +1,13 @@ +# Title1 + +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. + +