Skip to content
Permalink
Browse files

Fix some issues with tests

  • Loading branch information...
mpourismaiel committed Feb 2, 2019
1 parent ef5a6c9 commit 32e107f5a2e59e95500bbc18bc127cb8659da935
Showing with 66 additions and 66 deletions.
  1. +8 −8 _tests/align-generator/index.js
  2. +7 −7 _tests/colors-generator/index.js
  3. +1 −1 exampleSite/content/dev/alignments/footer/footer-example-center.md
  4. +1 −1 exampleSite/content/dev/alignments/footer/footer-example-left.md
  5. +1 −1 exampleSite/content/dev/alignments/footer/footer-example-right.md
  6. +1 −1 exampleSite/content/dev/alignments/graph/graph-center/index.md
  7. +1 −1 exampleSite/content/dev/alignments/graph/graph-left/index.md
  8. +1 −1 exampleSite/content/dev/alignments/graph/graph-right/index.md
  9. +1 −1 exampleSite/content/dev/alignments/hero/hero-center/index.md
  10. +1 −1 exampleSite/content/dev/alignments/hero/hero-left/index.md
  11. +1 −1 exampleSite/content/dev/alignments/hero/hero-right/index.md
  12. +1 −1 exampleSite/content/dev/alignments/item/item_button-center-center.md
  13. +1 −1 exampleSite/content/dev/alignments/item/item_button-center-left.md
  14. +1 −1 exampleSite/content/dev/alignments/item/item_button-center-right.md
  15. +1 −1 exampleSite/content/dev/alignments/item/item_button-left-center.md
  16. +1 −1 exampleSite/content/dev/alignments/item/item_button-left-left.md
  17. +1 −1 exampleSite/content/dev/alignments/item/item_button-left-right.md
  18. +1 −1 exampleSite/content/dev/alignments/item/item_button-right-center.md
  19. +1 −1 exampleSite/content/dev/alignments/item/item_button-right-left.md
  20. +1 −1 exampleSite/content/dev/alignments/item/item_button-right-right.md
  21. +1 −1 exampleSite/content/dev/alignments/item/item_icon-center-center.md
  22. +1 −1 exampleSite/content/dev/alignments/item/item_icon-center-left.md
  23. +1 −1 exampleSite/content/dev/alignments/item/item_icon-center-right.md
  24. +1 −1 exampleSite/content/dev/alignments/item/item_icon-left-center.md
  25. +1 −1 exampleSite/content/dev/alignments/item/item_icon-left-left.md
  26. +1 −1 exampleSite/content/dev/alignments/item/item_icon-left-right.md
  27. +1 −1 exampleSite/content/dev/alignments/item/item_icon-right-center.md
  28. +1 −1 exampleSite/content/dev/alignments/item/item_icon-right-left.md
  29. +1 −1 exampleSite/content/dev/alignments/item/item_icon-right-right.md
  30. +1 −1 exampleSite/content/dev/alignments/item/item_image-button-left-center.md
  31. +1 −1 exampleSite/content/dev/alignments/item/item_image-button-left-left.md
  32. +1 −1 exampleSite/content/dev/alignments/item/item_image-button-left-right.md
  33. +1 −1 exampleSite/content/dev/alignments/item/item_image-center-center.md
  34. +1 −1 exampleSite/content/dev/alignments/item/item_image-center-left.md
  35. +1 −1 exampleSite/content/dev/alignments/item/item_image-center-right.md
  36. +1 −1 exampleSite/content/dev/alignments/item/item_image-only-center.md
  37. +1 −1 exampleSite/content/dev/alignments/item/item_image-only-left.md
  38. +1 −1 exampleSite/content/dev/alignments/item/item_image-only-right.md
  39. +1 −1 exampleSite/content/dev/alignments/item/item_image-right-center.md
  40. +1 −1 exampleSite/content/dev/alignments/item/item_image-right-left.md
  41. +1 −1 exampleSite/content/dev/alignments/item/item_image-right-right.md
  42. +1 −1 exampleSite/content/dev/alignments/item/item_image-table-left-center.md
  43. +1 −1 exampleSite/content/dev/alignments/item/item_image-table-left-left.md
  44. +1 −1 exampleSite/content/dev/alignments/item/item_image-table-left-right.md
  45. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-center.md
  46. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-left.md
  47. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-multi-price-center.md
  48. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-multi-price-left.md
  49. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-multi-price-right.md
  50. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-only-editable-center.md
  51. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-only-editable-left.md
  52. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-only-editable-right.md
  53. +1 −1 exampleSite/content/dev/alignments/stripe/stripe-right.md
@@ -69,14 +69,14 @@ const fragments = fs.readdirSync(paths.fragments).reduce((tmp, dir) => {

fs.mkdirSync(paths.devAligns);
fs.mkdirSync(`${paths.devAligns}/_index`);
fs.writeFile(`${paths.devAligns}/_index.md`, index, "utf-8", () => {});
fs.writeFile(`${paths.devAligns}/_index.md`, index, "utf8", () => {});
fs.writeFile(
`${paths.devAligns}/_index/index.md`,
content,
"utf-8",
"utf8",
() => {}
);
fs.writeFile(`${paths.devAligns}/_index/list.md`, list, "utf-8", () => {});
fs.writeFile(`${paths.devAligns}/_index/list.md`, list, "utf8", () => {});

Object.keys(fragments).forEach(fragment => {
let weight = 100;
@@ -85,15 +85,15 @@ Object.keys(fragments).forEach(fragment => {
parseBlackFriday(
fragment,
weight,
fs.readFileSync(fragments[fragment].fragments[filename], "utf-8"),
fs.readFileSync(fragments[fragment].fragments[filename], "utf8"),
filename
);
});

Object.keys(fragments[fragment].nested).forEach(dir => {
const index = fragments[fragment].nested[dir]["index.md"];
weight += 20;
if (parseBlackFriday(fragment, weight, fs.readFileSync(index, "utf-8"), "index", dir) === false) {
if (parseBlackFriday(fragment, weight, fs.readFileSync(index, "utf8"), "index", dir) === false) {
return;
}

@@ -138,7 +138,7 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
fs.writeFile(
`${paths.devAligns}/${fragment}/index.md`,
indexTemplate.replace(/%fragment%/g, fragment),
"utf-8",
"utf8",
() => {}
);

@@ -150,7 +150,7 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
.replace(/weight\s?=\s?"?\d+"?/im, `weight = ${weight + i}`);

if (content.indexOf("title_align") === -1) {
tmp = tmp.slice(0, tmp.indexOf("+++") + 3) + `\ntitle_align="${alignment}"\n` + tmp.slice(tmp.indexOf("+++"));
tmp = tmp.slice(0, tmp.indexOf("+++") + 3) + `\ntitle_align="${alignment}"\n` + tmp.slice(tmp.indexOf("+++") + 3);
}

// Write the edited config into the fragment, whether it's in a nested directory or not
@@ -159,7 +159,7 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
(dir ? `/${dir}-${alignment}` : "")}/${filename +
(dir ? "" : `-${alignment}`)}.md`,
tmp,
"utf-8",
"utf8",
() => {}
);
});
@@ -68,14 +68,14 @@ const fragments = fs.readdirSync(paths.fragments).reduce((tmp, dir) => {

fs.mkdirSync(paths.devColors);
fs.mkdirSync(`${paths.devColors}/_index`);
fs.writeFile(`${paths.devColors}/_index.md`, index, "utf-8", () => {});
fs.writeFile(`${paths.devColors}/_index.md`, index, "utf8", () => {});
fs.writeFile(
`${paths.devColors}/_index/index.md`,
content,
"utf-8",
"utf8",
() => {}
);
fs.writeFile(`${paths.devColors}/_index/list.md`, list, "utf-8", () => {});
fs.writeFile(`${paths.devColors}/_index/list.md`, list, "utf8", () => {});

Object.keys(fragments).forEach(fragment => {
let weight = 100;
@@ -84,15 +84,15 @@ Object.keys(fragments).forEach(fragment => {
parseBlackFriday(
fragment,
weight,
fs.readFileSync(fragments[fragment].fragments[filename], "utf-8"),
fs.readFileSync(fragments[fragment].fragments[filename], "utf8"),
filename
);
});

Object.keys(fragments[fragment].nested).forEach(dir => {
const index = fragments[fragment].nested[dir]["index.md"];
weight += 20;
if (parseBlackFriday(fragment, weight, fs.readFileSync(index, "utf-8"), "index", dir) === false) {
if (parseBlackFriday(fragment, weight, fs.readFileSync(index, "utf8"), "index", dir) === false) {
return;
}

@@ -137,7 +137,7 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
fs.writeFile(
`${paths.devColors}/${fragment}/index.md`,
indexTemplate.replace(/%fragment%/g, fragment),
"utf-8",
"utf8",
() => {}
);

@@ -150,7 +150,7 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
(dir ? `/${dir}-${background}` : "")}/${filename +
(dir ? "" : `-${background}`)}.md`,
tmp,
"utf-8",
"utf8",
() => {}
);
});
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "footer"
#disabled = true
date = "2016-09-07"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "footer"
#disabled = true
date = "2016-09-07"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "footer"
#disabled = true
date = "2016-09-07"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "graph"
weight = 121
background = "secondary"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "graph"
weight = 120
background = "secondary"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "graph"
weight = 122
background = "secondary"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "hero"
#disabled = true
date = "2016-09-07"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "hero"
#disabled = true
date = "2016-09-07"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "hero"
#disabled = true
date = "2016-09-07"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="right"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="center"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"
@@ -1,6 +1,6 @@
+++
title_align="left"
+++

fragment = "item"
#disabled = false
date = "2017-10-04"

1 comment on commit 32e107f

@deepcode-ci-bot

This comment has been minimized.

Copy link

deepcode-ci-bot bot commented on 32e107f Feb 2, 2019

DeepCode analyzed this commit.
There are no new issues.1 important issue was fixed.

Click to see more details.

Please sign in to comment.
You can’t perform that action at this time.