Skip to content

Commit

Permalink
Adjust expected output
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed May 11, 2017
1 parent 2713592 commit 7a9ffa9
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions test/spriteBackgroundImages.js
Expand Up @@ -58,8 +58,11 @@ describe('spriteBackgroundImages', function () {
.queue(function (assetGraph) {
expect(assetGraph, 'to contain asset', 'Png');
expect(assetGraph, 'to contain relations', 'CssImage', 2);
expect(assetGraph.findAssets({type: 'Css'})[0].text, 'to match',
/^\.icon-foo \{\n background-image: url\(sprite-.*?-\d+\.png\);\n background-position: 0 0;\n\}\n\n\.icon-bar \{\n background-image: url\(sprite-.*?-\d+\.png\);\n background-position: -12px 0;\n\}\n$/);
expect(
assetGraph.findAssets({type: 'Css'})[0].text,
'to match',
/^\.icon-foo \{\n background-image: url\(sprite-.*?-\d+\.png\);background-position: 0 0;\n\}\n\n\.icon-bar \{\n background-image: url\(sprite-.*?-\d+\.png\);background-position: -12px 0;\n\}\n$/
);
});
});

Expand All @@ -74,8 +77,11 @@ describe('spriteBackgroundImages', function () {
.queue(function (assetGraph) {
expect(assetGraph, 'to contain asset', 'Png');
expect(assetGraph, 'to contain relations', 'CssImage', 2);
expect(assetGraph.findAssets({type: 'Css'})[0].text, 'to match',
/^\.foo \{\n background-image: url\((sprite-.*?-\d+\.png)\);\n}\n\n\.foo-foo \{\n background-image: url\(\1\);\n background-position: 0 0\n\}\n\n\.foo-bar \{\n background-position: -12px 0\n\}\n$/);
expect(
assetGraph.findAssets({type: 'Css'})[0].text,
'to match',
/^\.foo \{background-image: url\((sprite-.*?-\d+\.png)\);\n}\n\n\.foo-foo \{\n background-image: url\(\1\);background-position: 0 0\n\}\n\n\.foo-bar \{background-position: -12px 0\n\}\n$/
);
});
});

Expand Down Expand Up @@ -108,8 +114,11 @@ describe('spriteBackgroundImages', function () {
.queue(function (assetGraph) {
expect(assetGraph, 'to contain asset', 'Png');
expect(assetGraph, 'to contain relations', 'CssImage');
expect(assetGraph.findAssets({type: 'Css'})[0].text, 'to match',
/^\.icon \{\n background-image: url\(sprite-.*?-\d+\.png\) !important;\n}\n\n\.icon-foo \{\n background-position: 0 0;\n\}\n$/);
expect(
assetGraph.findAssets({type: 'Css'})[0].text,
'to match',
/^\.icon \{\n background-image: url\(sprite-.*?-\d+\.png\) !important;\n}\n\n\.icon-foo \{background-position: 0 0;\n\}\n$/
);
});
});

Expand All @@ -124,8 +133,11 @@ describe('spriteBackgroundImages', function () {
.queue(function (assetGraph) {
expect(assetGraph, 'to contain asset', 'Png');
expect(assetGraph, 'to contain relation', 'CssImage');
expect(assetGraph.findAssets({type: 'Css'})[0].text, 'to match',
/^\.icon \{\n background: red url\(sprite-.*?-\d+\.png\) !important;\n}\n\n\.icon-foo \{\n background-position: 0 0;\n\}\n$/);
expect(
assetGraph.findAssets({type: 'Css'})[0].text,
'to match',
/^\.icon \{\n background: red url\(sprite-.*?-\d+\.png\) !important;\n}\n\n\.icon-foo \{background-position: 0 0;\n\}\n$/
);
});
});

Expand All @@ -140,8 +152,11 @@ describe('spriteBackgroundImages', function () {
.queue(function (assetGraph) {
expect(assetGraph, 'to contain asset', 'Png');
expect(assetGraph, 'to contain relations', 'CssImage', 2);
expect(assetGraph.findAssets({type: 'Css'})[0].text, 'to match',
/^\.icon \{\n background-image: url\((sprite-.*?-\d+\.png)\);\n}\n\n\.icon-foo \{\n background-position: 0 0;\n\}\n\n.icon-bar \{\n background: -12px 4px;\n}\n\n.icon-quux \{\n background: url\(\1\) -1610px -4px;\n}\n$/);
expect(
assetGraph.findAssets({type: 'Css'})[0].text,
'to match',
/^\.icon \{background-image: url\((sprite-.*?-\d+\.png)\);\n}\n\n\.icon-foo \{background-position: 0 0;\n\}\n\n.icon-bar \{\n background: -12px 4px;\n}\n\n.icon-quux \{\n background: url\(\1\) -1610px -4px;\n}\n$/
);
});
});

Expand All @@ -156,8 +171,11 @@ describe('spriteBackgroundImages', function () {
.queue(function (assetGraph) {
expect(assetGraph, 'to contain asset', 'Png');
expect(assetGraph, 'to contain relations', 'CssImage', 2);
expect(assetGraph.findAssets({type: 'Css'})[0].text, 'to match',
/^\.icon \{\n background-image: url\((sprite-.*?-\d+\.png)\);\n}\n\n\.icon-foo \{\n background-position: 0 0 !important;\n\}\n\n\.icon-bar \{\n background-position: -112px -40px !important;\n\}\n\n\.icon-quux \{\n background-image: url\(\1\);\n background-position: -1610px 2px !important;\n\}\n$/);
expect(
assetGraph.findAssets({type: 'Css'})[0].text,
'to match',
/^\.icon \{background-image: url\((sprite-.*?-\d+\.png)\);\n}\n\n\.icon-foo \{\n background-position: 0 0 !important;\n\}\n\n\.icon-bar \{\n background-position: -112px -40px !important;\n\}\n\n\.icon-quux \{\n background-image: url\(\1\);\n background-position: -1610px 2px !important;\n\}\n$/
);
});
});

Expand All @@ -172,8 +190,10 @@ describe('spriteBackgroundImages', function () {
.queue(function (assetGraph) {
expect(assetGraph, 'to contain asset', 'Png');
expect(assetGraph, 'to contain relations', 'CssImage', 2);
expect(assetGraph.findAssets({type: 'Css'})[0].text, 'to match',
/^\.icon \{\n background-image: (url\(sprite-.*?-\d+\.png\));\n}\n\n\.icon-foo \{\n background-image: \1 !important;\n background-position: 0 0;\n\}\n\n\.icon-bar \{\n background: red !important;\n background-position: -12px 0;\n\}\n$/);
expect(
assetGraph.findAssets({type: 'Css'})[0].text,
'to match',
/^\.icon \{background-image: (url\(sprite-.*?-\d+\.png\));\n}\n\n\.icon-foo \{\n background-image: \1 !important;background-position: 0 0;\n\}\n\n\.icon-bar \{\n background: red !important;background-position: -12px 0;\n\}\n$/);
});
});

Expand Down

0 comments on commit 7a9ffa9

Please sign in to comment.