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

Commit

Permalink
Cleaup changelogs, add unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Mar 9, 2022
1 parent be605c2 commit 20f8a29
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
8 changes: 8 additions & 0 deletions changelog/unreleased/change-remove-resource-status-indicators
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Change: Remove OcStatusIndicators from OcResource

We've removed OcStatusIndicators from OcResource
since it will be moved in a separate column

https://github.com/owncloud/web/issues/5976
https://github.com/owncloud/web/pull/6552
https://github.com/owncloud/owncloud-design-system/pull/2014
8 changes: 8 additions & 0 deletions changelog/unreleased/enhancement-redesign-status-indicators
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Redesign OcStatusIndicators

We've redesigned the share/status indicators to fit
in a separate column in the ResourceTable in web

https://github.com/owncloud/web/issues/5976
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,51 @@
import StatusIndicators from "./OcStatusIndicators.vue"
import { mount } 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 20f8a29

Please sign in to comment.