Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@
/>

<div class="flex items-center ml-auto">
<oc-button
class="mr-4"
data-testid="button-cancel"
color-role="chrome"
appearance="raw-inverse"
no-hover
@click="emitCancel"
>
<oc-button class="mr-4" data-testid="button-cancel" appearance="outline" @click="emitCancel">
{{ $gettext('Cancel') }}
</oc-button>
<oc-button
v-if="!isLocationPicker && !isFilePicker"
key="btn-share"
class="mr-4"
data-testid="button-share"
color-role="chrome"
appearance="filled"
:disabled="isShareLinksButtonDisabled"
@click="createLinkAction.handler({ resources: selectedFiles, space })"
Expand All @@ -38,7 +30,6 @@
v-if="isLocationPicker"
data-testid="button-select"
appearance="filled"
color-role="chrome"
:disabled="isChooseButtonDisabled"
@click="emitSelect"
>
Expand All @@ -48,7 +39,6 @@
v-else
data-testid="button-select"
appearance="filled"
color-role="chrome"
:disabled="isAttachAsCopyButtonDisabled"
@click="emitSelect"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,34 @@ describe('EmbedActions', () => {
expect(mocks.createLinkHandlerMock).toHaveBeenCalledTimes(1)
})
})

describe('button appearance', () => {
// the actions are rendered on top of the chrome colored area, hence the buttons must not use
// the chrome color role themselves. Otherwise they'd be invisible on their own background.
it('should render the cancel action as outlined button', () => {
const { wrapper } = getWrapper({ isLocationPicker: true })
const classes = wrapper.find(selectors.btnCancel).classes()

expect(classes).toContain('oc-button-secondary-outline')
expect(classes).not.toContain('oc-button-chrome')
})

it('should render the select action as filled button', () => {
const { wrapper } = getWrapper({ isLocationPicker: true })
const classes = wrapper.find(selectors.btnSelect).classes()

expect(classes).toContain('oc-button-secondary-filled')
expect(classes).not.toContain('oc-button-chrome')
})

it('should render the share action as filled button', () => {
const { wrapper } = getWrapper({ selectedIds: ['1'] })
const classes = wrapper.find(selectors.btnShare).classes()

expect(classes).toContain('oc-button-secondary-filled')
expect(classes).not.toContain('oc-button-chrome')
})
})
})

function getWrapper(
Expand Down