20 lines
665 B
JavaScript
20 lines
665 B
JavaScript
import { module, test } from "qunit";
|
|
/* global BreakString:true */
|
|
|
|
module("Unit | Utility | breakString", function () {
|
|
test("breakString", function (assert) {
|
|
const b = (s, hint) => new BreakString(s).break(hint);
|
|
|
|
assert.equal(b("hello"), "hello");
|
|
assert.equal(b("helloworld"), "helloworld");
|
|
assert.equal(b("HeMans11"), "He<wbr>​Mans<wbr>​11");
|
|
assert.equal(b("he_man"), "he_<wbr>​man");
|
|
assert.equal(b("he11111"), "he<wbr>​11111");
|
|
assert.equal(b("HRCBob"), "HRC<wbr>​Bob");
|
|
assert.equal(
|
|
b("bobmarleytoo", "Bob Marley Too"),
|
|
"bob<wbr>​marley<wbr>​too"
|
|
);
|
|
});
|
|
});
|