Skip to content

Commit 20a5813

Browse files
committed
Additional test
1 parent 55ca168 commit 20a5813

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

__tests__/index.spec.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,21 @@ describe("Ansi", () => {
178178
);
179179
});
180180

181+
test("can handle URLs inside query parameters", () => {
182+
const el = shallow(
183+
React.createElement(
184+
Ansi,
185+
{ linkify: true },
186+
"www.google.com/?q=https://www.google.com"
187+
)
188+
);
189+
expect(el).not.toBeNull();
190+
expect(el.text()).toBe("www.google.com/?q=https://www.google.com");
191+
expect(el.html()).toBe(
192+
'<code><span><a href="http://www.google.com/?q=https://www.google.com" target="_blank">www.google.com/?q=https://www.google.com</a></span></code>'
193+
);
194+
});
195+
181196
describe("useClasses options", () => {
182197
test("can add the font color class", () => {
183198
const el = shallow(

0 commit comments

Comments
 (0)