mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-08-04 01:42:00 +00:00
feat: multiline text in repo description (#206)
* Enable multi line repo card descriptions * Adjust unit tests to multi line descriptions * refactor: refactored code & fixed tests * style: minor height adjustments * chore: codecov stuck Co-authored-by: anuraghazra <hazru.anurag@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ const {
|
||||
renderError,
|
||||
FlexLayout,
|
||||
getCardColors,
|
||||
wrapTextMultiline,
|
||||
} = require("../src/utils");
|
||||
|
||||
const { queryByTestId } = require("@testing-library/dom");
|
||||
@@ -108,3 +109,28 @@ describe("Test utils.js", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("wrapTextMultiline", () => {
|
||||
it("should not wrap small texts", () => {
|
||||
{
|
||||
let multiLineText = wrapTextMultiline("Small text should not wrap");
|
||||
expect(multiLineText).toEqual(["Small text should not wrap"]);
|
||||
}
|
||||
});
|
||||
it("should wrap large texts", () => {
|
||||
let multiLineText = wrapTextMultiline(
|
||||
"Hello world long long long text",
|
||||
20,
|
||||
3
|
||||
);
|
||||
expect(multiLineText).toEqual(["Hello world long", "long long text"]);
|
||||
});
|
||||
it("should wrap large texts and limit max lines", () => {
|
||||
let multiLineText = wrapTextMultiline(
|
||||
"Hello world long long long text",
|
||||
10,
|
||||
2
|
||||
);
|
||||
expect(multiLineText).toEqual(["Hello", "world long..."]);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user