This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #806 from owncloud/breadcrumbs-lead-size
- Loading branch information
Showing
5 changed files
with
137 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Enhancement: Add lead breadcrumb variation | ||
|
||
We've added a lead variation to the breadcrumbs. | ||
This variation gives large font size to breadcrumb items. | ||
|
||
https://github.com/owncloud/owncloud-design-system/pull/806 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { shallowMount } from "@vue/test-utils" | ||
import Breadcrumb from "./OcBreadcrumb.vue" | ||
|
||
const items = [ | ||
{ text:'First folder', to:{ path:'folder' } }, | ||
{ text:'Subfolder', onClick: () => alert('Breadcrumb clicked!') }, | ||
{ text:'Deep', to:{ path:'folder' } }, | ||
{ text:'Deeper ellipsize in responsive mode' }, | ||
] | ||
|
||
describe("OcBreadcrumb", () => { | ||
it("sets correct variation", () => { | ||
const wrapper = shallowMount(Breadcrumb, { | ||
propsData: { | ||
variation: "lead", | ||
items | ||
} | ||
}) | ||
|
||
expect(wrapper.props().variation).toMatch("lead") | ||
expect(wrapper.classes()).toContain("oc-breadcrumb-lead") | ||
expect(wrapper).toMatchSnapshot() | ||
}), | ||
|
||
it("displays all items", () => { | ||
const wrapper = shallowMount(Breadcrumb, { | ||
propsData: { | ||
items | ||
} | ||
}) | ||
|
||
expect(wrapper.findAll(".oc-breadcrumb-list-item").length).toBe(4) | ||
expect(wrapper).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`OcBreadcrumb displays all items 1`] = ` | ||
<div class="oc-breadcrumb oc-breadcrumb-default"> | ||
<ul class="oc-breadcrumb-list"> | ||
<li class="oc-breadcrumb-list-item"> | ||
<router-link-stub tag="a" to="[object Object]">First folder</router-link-stub> | ||
</li> | ||
<li class="oc-breadcrumb-list-item"><a>Subfolder</a></li> | ||
<li class="oc-breadcrumb-list-item"> | ||
<router-link-stub tag="a" to="[object Object]">Deep</router-link-stub> | ||
</li> | ||
<li class="oc-breadcrumb-list-item"><span>Deeper ellipsize in responsive mode</span></li> | ||
</ul> | ||
<div class="oc-breadcrumb-drop"><label class="oc-breadcrumb-drop-label"><span class="oc-breadcrumb-drop-label-text">Deeper ellipsize in responsive mode</span> | ||
<oc-icon-stub name="expand_more" arialabel="icon" type="span" size="small" variation="system" class="oc-breadcrumb-drop-label-icon"></oc-icon-stub> | ||
</label> | ||
<oc-drop-stub toggle="- *" position="bottom-left" mode="click" options="[object Object]"> | ||
<ul class="uk-nav uk-nav-default"> | ||
<li> | ||
<router-link-stub tag="a" to="[object Object]">Deep</router-link-stub> | ||
</li> | ||
<li><a>Subfolder</a></li> | ||
<li> | ||
<router-link-stub tag="a" to="[object Object]">First folder</router-link-stub> | ||
</li> | ||
</ul> | ||
</oc-drop-stub> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`OcBreadcrumb sets correct variation 1`] = ` | ||
<div class="oc-breadcrumb oc-breadcrumb-lead"> | ||
<ul class="oc-breadcrumb-list"> | ||
<li class="oc-breadcrumb-list-item"> | ||
<router-link-stub tag="a" to="[object Object]">First folder</router-link-stub> | ||
</li> | ||
<li class="oc-breadcrumb-list-item"><a>Subfolder</a></li> | ||
<li class="oc-breadcrumb-list-item"> | ||
<router-link-stub tag="a" to="[object Object]">Deep</router-link-stub> | ||
</li> | ||
<li class="oc-breadcrumb-list-item"><span>Deeper ellipsize in responsive mode</span></li> | ||
</ul> | ||
<div class="oc-breadcrumb-drop"><label class="oc-breadcrumb-drop-label"><span class="oc-breadcrumb-drop-label-text">Deeper ellipsize in responsive mode</span> | ||
<oc-icon-stub name="expand_more" arialabel="icon" type="span" size="small" variation="system" class="oc-breadcrumb-drop-label-icon"></oc-icon-stub> | ||
</label> | ||
<oc-drop-stub toggle="- *" position="bottom-left" mode="click" options="[object Object]"> | ||
<ul class="uk-nav uk-nav-default"> | ||
<li> | ||
<router-link-stub tag="a" to="[object Object]">Deep</router-link-stub> | ||
</li> | ||
<li><a>Subfolder</a></li> | ||
<li> | ||
<router-link-stub tag="a" to="[object Object]">First folder</router-link-stub> | ||
</li> | ||
</ul> | ||
</oc-drop-stub> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters