Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breadcrumbs] Add new component #3106

Merged
merged 22 commits into from
Nov 2, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests to Breadcrumb
invliD committed Nov 1, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 963bad73e8cbeaf589ba2c1943f054ec9b1bb3c9
10 changes: 10 additions & 0 deletions packages/core/test/breadcrumbs/breadcrumbTests.tsx
Original file line number Diff line number Diff line change
@@ -30,4 +30,14 @@ describe("Breadcrumb", () => {
shallow(<Breadcrumb disabled={true} onClick={onClick} text="Hello" />).simulate("click");
assert.isTrue(onClick.notCalled, "onClick called");
});

it("renders an a tag if it's clickable", () => {
assert.lengthOf(shallow(<Breadcrumb href="test" />).find("a"), 1);
assert.lengthOf(shallow(<Breadcrumb href="test" />).find("span"), 0);
});

it("renders a span tag if it's not clickable", () => {
assert.lengthOf(shallow(<Breadcrumb />).find("a"), 0);
assert.lengthOf(shallow(<Breadcrumb />).find("span"), 1);
});
});