You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: __tests__/index.spec.tsx
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,34 @@ describe("Ansi", () => {
135
135
);
136
136
});
137
137
138
+
test("can linkify multiple links",()=>{
139
+
constel=shallow(
140
+
React.createElement(
141
+
Ansi,
142
+
{linkify: true},
143
+
"this is a link: www.google.com and this is a second link: www.microsoft.com"
144
+
)
145
+
);
146
+
expect(el).not.toBeNull();
147
+
expect(el.text()).toBe("this is a link: www.google.com and this is a second link: www.microsoft.com");
148
+
expect(el.html()).toBe(
149
+
'<code><span>this is a link: <a href=\"http://www.google.com\" target=\"_blank\">www.google.com</a> and this is a second link: <a href=\"http://www.microsoft.com\" target=\"_blank\">www.microsoft.com</a></span></code>'
150
+
);
151
+
});
152
+
153
+
test("creates a minimal number of nodes when using linkify",()=>{
154
+
constel=shallow(
155
+
React.createElement(
156
+
Ansi,
157
+
{linkify: true},
158
+
"this is a link: www.google.com and this is text after"
159
+
)
160
+
);
161
+
expect(el).not.toBeNull();
162
+
expect(el.text()).toBe("this is a link: www.google.com and this is text after");
0 commit comments