Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

Commit

Permalink
test jest
Browse files Browse the repository at this point in the history
  • Loading branch information
jbalsas committed Jun 1, 2017
1 parent c794d4f commit ea4db2e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/metal-clay-icon/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
1 change: 1 addition & 0 deletions packages/metal-clay-icon/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var metal = require('gulp-metal');

metal.registerTasks({
gulp: require('gulp'),
bundleCssFileName: 'metal-clay-icon.css',
bundleFileName: 'metal-clay-icon.js',
moduleName: 'metal-clay-icon'
Expand Down
2 changes: 1 addition & 1 deletion packages/metal-clay-icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"babel-preset-es2015": "^6.14.0",
"clay": "liferay/clay#develop",
"gulp": "^3.8.11",
"gulp-metal": "^1.0.0",
"gulp-metal": "^2.0.0",
"karma-html2js-preprocessor": "^1.0.0",
"metal-karma-config": "^2.1.1"
}
Expand Down
27 changes: 27 additions & 0 deletions packages/metal-clay-icon/src/__tests__/MetalClayIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

import MetalClayIcon from '../MetalClayIcon';

const spritemap = '../node_modules/lexicon-ux/build/images/icons/icons.svg';

let clayIcon;

describe('MetalClayIcon', function() {
afterEach(() => {
if (clayIcon) {
clayIcon.dispose();
}
});

it('should generate markup for icon `add-cell`', function() {
clayIcon = new MetalClayIcon(
{
spritemap: spritemap,
symbol: 'add-foo'
}
);

console.log(clayIcon.element.outerHTML);
expect(clayIcon.element.outerHTML).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`MetalClayIcon should generate markup for icon \`add-cell\` 1`] = `"<div><svg aria-hidden=\\"true\\" class=\\"lexicon-icon lexicon-icon-add-cell\\" key=\\"undefined\\"><use xlink:href=\\"../node_modules/lexicon-ux/build/images/icons/icons.svg#add-cell\\" key=\\"undefined\\"></use></svg></div>"`;

0 comments on commit ea4db2e

Please sign in to comment.