Skip to content

Commit

Permalink
Fix unit tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Jan 5, 2023
1 parent 9d41f23 commit 48702c2
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ describe('SpacesList', () => {
const { wrapper } = getWrapper({ mountType: shallowMount, spaces: spaceMocks })
wrapper.vm.sortBy = prop
await wrapper.vm.$nextTick()
expect(wrapper.find(selectors.ocTableStub).props().data[0].id).toBe(spaceMocks[0].id)
expect(wrapper.findComponent<any>(selectors.ocTableStub).props().data[0].id).toBe(
spaceMocks[0].id
)
wrapper.vm.sortDir = 'desc'
await wrapper.vm.$nextTick()
expect(wrapper.find(selectors.ocTableStub).props().data[0].id).toBe(spaceMocks[1].id)
expect(wrapper.findComponent<any>(selectors.ocTableStub).props().data[0].id).toBe(
spaceMocks[1].id
)
}
)
it('should set the sort parameters accordingly when calling "handleSort"', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,90 @@

exports[`SpacesList should render all spaces in a table 1`] = `
<div>
<table class="spaces-table oc-table oc-table-hover oc-table-sticky">
<table class="oc-table oc-table-hover oc-table-sticky spaces-table">
<thead class="oc-thead">
<tr class="oc-table-header-row" tabindex="-1">
<th class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-text-nowrap oc-table-header-cell oc-table-header-cell-select oc-pl-s " style="top: 0px;">
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-select oc-pl-s" style="top: 0px;">
<span class="oc-table-thead-content">
<occheckbox-stub class="oc-ml-s" hidelabel="true" id="oc-checkbox-1" label="Select all spaces" size="large"></occheckbox-stub>
<oc-checkbox-stub class="oc-ml-s" hidelabel="true" id="oc-checkbox-1" label="Select all spaces" size="large"></oc-checkbox-stub>
</span>
<!---->
<!--v-if-->
</th>
<th class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-text-nowrap oc-table-header-cell oc-table-header-cell-icon" style="top: 0px;">
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-icon" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text"></span>
<!---->
<!--v-if-->
</th>
<th aria-sort="ascending" class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-name" style="top: 0px;">
<th aria-sort="ascending" class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-name" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Name</span>
<button aria-label="Sort by name" class="oc-button-sort oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw" type="button">
<button aria-label="Sort by name" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-button-sort" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-s oc-icon-passive">
<!---->
</span>
</button>
</th>
<th class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-manager" style="top: 0px;">
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-manager" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Manager</span>
<!---->
<!--v-if-->
</th>
<th aria-sort="none" class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-members" style="top: 0px;">
<th aria-sort="none" class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-members" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Members</span>
<button aria-label="Sort by members" class="oc-button-sort oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible" type="button">
<button aria-label="Sort by members" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible oc-button-sort" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-s oc-icon-passive">
<!---->
</span>
</button>
</th>
<th aria-sort="none" class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-availableQuota" style="top: 0px;">
<th aria-sort="none" class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-availableQuota" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Available Quota</span>
<button aria-label="Sort by availableQuota" class="oc-button-sort oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible" type="button">
<button aria-label="Sort by availableQuota" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible oc-button-sort" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-s oc-icon-passive">
<!---->
</span>
</button>
</th>
<th aria-sort="none" class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-usedQuota" style="top: 0px;">
<th aria-sort="none" class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-usedQuota" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Used Quota</span>
<button aria-label="Sort by usedQuota" class="oc-button-sort oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible" type="button">
<button aria-label="Sort by usedQuota" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible oc-button-sort" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-s oc-icon-passive">
<!---->
</span>
</button>
</th>
<th aria-sort="none" class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-remainingQuota" style="top: 0px;">
<th aria-sort="none" class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-remainingQuota" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Remaining Quota</span>
<button aria-label="Sort by remainingQuota" class="oc-button-sort oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible" type="button">
<button aria-label="Sort by remainingQuota" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible oc-button-sort" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-s oc-icon-passive">
<!---->
</span>
</button>
</th>
<th aria-sort="none" class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-mdate" style="top: 0px;">
<th aria-sort="none" class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-mdate" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Modified</span>
<button aria-label="Sort by mdate" class="oc-button-sort oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible" type="button">
<button aria-label="Sort by mdate" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible oc-button-sort" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-s oc-icon-passive">
<!---->
</span>
</button>
</th>
<th aria-sort="none" class="oc-th oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-table-header-cell oc-table-header-cell-status oc-pr-s" style="top: 0px;">
<th aria-sort="none" class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-status oc-pr-s" style="top: 0px;">
<!-- TODO: Vue warning "v-if/else branches must use unique keys." -->
<span class="oc-table-thead-content header-text">Status</span>
<button aria-label="Sort by status" class="oc-button-sort oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible" type="button">
<button aria-label="Sort by status" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-invisible oc-button-sort" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-s oc-icon-passive">
<!---->
</span>
Expand All @@ -79,32 +95,28 @@ exports[`SpacesList should render all spaces in a table 1`] = `
</thead>
<tbody>
<tr class="oc-tbody-tr oc-tbody-tr-1" data-item-id="1" draggable="false" tabindex="-1">
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-table-data-cell oc-table-data-cell-select oc-pl-s ">
<occheckbox-stub class="oc-ml-s" hidelabel="true" id="oc-checkbox-2" label="Select 1 Some space" option="[object Object]" size="large"></occheckbox-stub>
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-td oc-table-data-cell oc-table-data-cell-select oc-pl-s">
<oc-checkbox-stub class="oc-ml-s" hidelabel="true" id="oc-checkbox-2" label="Select 1 Some space" option="[object Object]" size="large"></oc-checkbox-stub>
</td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-table-data-cell oc-table-data-cell-icon">
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-td oc-table-data-cell oc-table-data-cell-icon">
<span class="oc-icon oc-icon-m oc-icon-passive">
<!---->
</span>
</td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-name">
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-name">
<span class="spaces-table-space-name" data-test-space-name="1 Some space">1 Some space</span>
</td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-manager">
user1, user2... +1
</td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-members">
3
</td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-availableQuota"> 1 GB </td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-usedQuota"> 0.00 GB </td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-remainingQuota"> 1 GB </td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-mdate">
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-manager">user1, user2... +1</td>
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-members">3</td>
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-availableQuota">1 GB</td>
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-usedQuota">0.00 GB</td>
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-remainingQuota">1 GB</td>
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-mdate">
<span tabindex="0"></span>
</td>
<td class="oc-td oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-table-data-cell oc-table-data-cell-status oc-pr-s">
<td class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-td oc-table-data-cell oc-table-data-cell-status oc-pr-s">
<span class="oc-flex oc-flex-middle">
<span class="oc-mr-s oc-icon oc-icon-m oc-icon-success">
<span class="oc-icon oc-icon-m oc-icon-success oc-mr-s">
<!---->
</span>
<span>Enabled</span>
Expand All @@ -115,6 +127,7 @@ exports[`SpacesList should render all spaces in a table 1`] = `
<tfoot class="oc-table-footer">
<tr class="oc-table-footer-row">
<td class="oc-table-footer-cell" colspan="10">
<!-- @slot Footer of the table -->
<div class="oc-text-nowrap oc-text-center oc-width-1-1 oc-my-s">
<p class="oc-text-muted">1 spaces in total</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
import Spaces from '../../../src/views/Spaces.vue'

const selectors = {
loadingSpinnerStub: 'apploadingspinner-stub',
spacesListStub: 'spaceslist-stub',
noContentMessageStub: 'nocontentmessage-stub'
loadingSpinnerStub: 'app-loading-spinner-stub',
spacesListStub: 'spaces-list-stub',
noContentMessageStub: 'no-content-message-stub'
}

describe('Spaces view', () => {
Expand Down Expand Up @@ -107,7 +107,8 @@ function getWrapper({ spaces = [{ name: 'Some Space' }] } = {}) {
stubs: {
AppLoadingSpinner: true,
NoContentMessage: true,
SpacesList: true
SpacesList: true,
OcBreadcrumb: true
}
}
})
Expand Down
Loading

0 comments on commit 48702c2

Please sign in to comment.