Skip to content

Commit

Permalink
Tests for util fns
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed Nov 13, 2018
1 parent cdf2907 commit 06c3145
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions webpack/util/__tests__/util_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as Util from "../util";
import { times } from "lodash";
import { validBotLocationData } from "../index";
import { parseClassNames } from "../../ui/util";
describe("util", () => {
describe("safeStringFetch", () => {
const data = {
Expand Down Expand Up @@ -165,3 +166,31 @@ describe("util", () => {
});

});

describe("parseClassNames", () => {
it("parses class names correctly", () => {
const base = "hello, base.";
const results = parseClassNames({
xs: 1,
sm: 2,
md: 3,
lg: 4,
xsOffset: 5,
smOffset: 6,
mdOffset: 7,
lgOffset: 8,
}, base);

[
base,
"col-xs-1",
"col-sm-2",
"col-md-3",
"col-lg-4",
"col-xs-offset-5",
"col-sm-offset-6",
"col-md-offset-7",
"col-lg-offset-8",
].map(string => expect(results).toContain(string));
});
});

0 comments on commit 06c3145

Please sign in to comment.