Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Feb 13, 2023
1 parent 7013625 commit eb76647
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('Spaces view', () => {
expect(wrapper.find(selectors.noContentMessageStub).exists()).toBeTruthy()
})
describe('toggle selection', () => {
describe('toggleSelectAllSpaces method', () => {
it('selects all spaces', async () => {
fdescribe('toggleSelectAllSpaces method', () => {
fit('selects all spaces', async () => {
const spaces = [{ name: 'Some Space' }]
const { wrapper } = getWrapper({ spaces })
await wrapper.vm.loadResourcesTask.last
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ exports[`Spaces view loading states should render spaces list after loading has
<!--v-if-->
</div>
</div>
<!--v-if-->
<div>
<spaces-list-stub class="" headerposition="0" selectedspaces="" spaces="[object Object]"></spaces-list-stub>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ describe('SpaceHeader', () => {

function getWrapper({ space = {}, sideBarOpen = false }) {
const mocks = {
...defaultComponentMocks()
...defaultComponentMocks(),
$permissionManager: {
canEditSpaceQuota: () => true
}
}
const store = createStore(defaultStoreMockOptions)
return mount(SpaceHeader, {
Expand All @@ -53,7 +56,10 @@ function getWrapper({ space = {}, sideBarOpen = false }) {
},
global: {
mocks,
plugins: [...defaultPlugins(), store]
plugins: [...defaultPlugins(), store],
stubs: {
'quota-modal': true
}
}
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ exports[`SpaceHeader should add the "squashed"-class when the sidebar is opened
</button>
</li>
</ul>
<ul class="oc-list oc-my-rm oc-mx-rm oc-files-context-actions oc-pb-s oc-pt-s oc-files-context-actions-border" id="oc-files-context-actions-secondaryActions">
<li class="context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover">
<button class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-files-actions-edit-quota-trigger action-menu-item" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-m oc-icon-passive">
<!---->
</span>
<span class="oc-files-context-action-label">Edit quota</span>
<!--v-if-->
<!--v-if-->
</button>
</li>
</ul>
<ul class="oc-list oc-my-rm oc-mx-rm oc-files-context-actions oc-pt-s" id="oc-files-context-actions-trashBin">
<li class="context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover">
<button class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-files-actions-delete-trigger action-menu-item" type="button">
Expand Down Expand Up @@ -105,6 +118,19 @@ exports[`SpaceHeader space image should show the default image if no other image
</button>
</li>
</ul>
<ul class="oc-list oc-my-rm oc-mx-rm oc-files-context-actions oc-pb-s oc-pt-s oc-files-context-actions-border" id="oc-files-context-actions-secondaryActions">
<li class="context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover">
<button class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-files-actions-edit-quota-trigger action-menu-item" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-m oc-icon-passive">
<!---->
</span>
<span class="oc-files-context-action-label">Edit quota</span>
<!--v-if-->
<!--v-if-->
</button>
</li>
</ul>
<ul class="oc-list oc-my-rm oc-mx-rm oc-files-context-actions oc-pt-s" id="oc-files-context-actions-trashBin">
<li class="context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover">
<button class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-files-actions-delete-trigger action-menu-item" type="button">
Expand Down Expand Up @@ -170,6 +196,19 @@ exports[`SpaceHeader space image should show the set image 1`] = `
</button>
</li>
</ul>
<ul class="oc-list oc-my-rm oc-mx-rm oc-files-context-actions oc-pb-s oc-pt-s oc-files-context-actions-border" id="oc-files-context-actions-secondaryActions">
<li class="context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover">
<button class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-files-actions-edit-quota-trigger action-menu-item" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-m oc-icon-passive">
<!---->
</span>
<span class="oc-files-context-action-label">Edit quota</span>
<!--v-if-->
<!--v-if-->
</button>
</li>
</ul>
<ul class="oc-list oc-my-rm oc-mx-rm oc-files-context-actions oc-pt-s" id="oc-files-context-actions-trashBin">
<li class="context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover">
<button class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-files-actions-delete-trigger action-menu-item" type="button">
Expand Down
2 changes: 1 addition & 1 deletion packages/web-pkg/src/mixins/spaces/editQuota.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default {
},
handler: this.$_editQuota_trigger,
isEnabled: ({ resources }) => {
if (!resources.length) {
if (!resources || !resources.length) {
return false
}
const isProjectSpace = 'spaceQuota' in resources[0]
Expand Down

0 comments on commit eb76647

Please sign in to comment.