Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Update changelog, add unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Mar 9, 2022
1 parent 4c85634 commit 8bdb73e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
6 changes: 4 additions & 2 deletions changelog/unreleased/enhancement-redesign-status-indicators
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Enhancement: Redesign OcStatusIndicators

We've redesigned the share/status indicators to fit
in a seperate column in the ResourceTable in web.
in a separate column in the ResourceTable in web and
removed it from OcResource.

https://github.com/owncloud/web/issues/5976
https://github.com/owncloud/web/pull/6552
https://github.com/owncloud/web/pull/6552
https://github.com/owncloud/owncloud-design-system/pull/2014
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import StatusIndicators from './OcStatusIndicators.vue'
import { mount, shallowMount } from "@vue/test-utils"

const fileResource = {
name: "forest.jpg",
path: "nature/forest.jpg",
thumbnail: "https://cdn.pixabay.com/photo/2015/09/09/16/05/forest-931706_960_720.jpg",
indicators: [],
type: "file",
isFolder: false,
extension: "jpg",
}
const indicator = {
id: "testid",
label: "testlabel",
type: "testtype",
handler: jest.fn()
}
describe("OcStatusIndicators", () => {
it("does call indicator handler on click", () => {
var called = false;
const wrapper = mount(StatusIndicators, {
propsData: {
resource: fileResource,
indicators: [{
id: "test",
label: "test",
type: "test",
handler: () => {
called = true;
}
}],
target: "test",
},
})
wrapper.find(".oc-status-indicators-indicator").trigger("click")
expect(called).toBeTruthy();
})
it("does create indicator with id", () => {
const wrapper = mount(StatusIndicators, {
propsData: {
resource: fileResource,
indicators: [indicator],
target: "test",
},
})
expect(wrapper.find(`#${indicator.id}`).exists()).toBeTruthy();
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:data-test-indicator-type="indicator.type"
@click="indicator.handler(resource, indicator.target)"
>
<oc-icon :name="indicator.icon" size="small" fill-type="line" variation="passive" />
<oc-icon :name="indicator.icon" size="small" fill-type="line" />
</oc-button>
<oc-icon
v-else
Expand Down

0 comments on commit 8bdb73e

Please sign in to comment.