-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommon.spec.js
More file actions
11 lines (8 loc) · 1.14 KB
/
Common.spec.js
File metadata and controls
11 lines (8 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
import { generateBC } from "../BreadcrumbGenerator";
test('BreadcrumbGenerator', () => {
expect(generateBC("mysite.com/pictures/holidays.html", " : ")).toBe('<a href="/">HOME</a> : <a href="/pictures/">PICTURES</a> : <span class="active">HOLIDAYS</span>');
expect(generateBC("www.codewars.com/users/GiacomoSorbi", " / ")).toBe('<a href="/">HOME</a> / <a href="/users/">USERS</a> / <span class="active">GIACOMOSORBI</span>');
expect(generateBC("www.microsoft.com/important/confidential/docs/index.htm#top", " * ")).toBe('<a href="/">HOME</a> * <a href="/important/">IMPORTANT</a> * <a href="/important/confidential/">CONFIDENTIAL</a> * <span class="active">DOCS</span>');
expect(generateBC("mysite.com/very-long-url-to-make-a-silly-yet-meaningful-example/example.asp", " > ")).toBe('<a href="/">HOME</a> > <a href="/very-long-url-to-make-a-silly-yet-meaningful-example/">VLUMSYME</a> > <span class="active">EXAMPLE</span>');
expect(generateBC("www.very-long-site_name-to-make-a-silly-yet-meaningful-example.com/users/giacomo-sorbi", " + ")).toBe('<a href="/">HOME</a> + <a href="/users/">USERS</a> + <span class="active">GIACOMO SORBI</span>');
});