Skip to content

Commit

Permalink
fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hfekete committed Nov 21, 2023
1 parent be538dd commit 8a9c8a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
>
<template v-slot:selection="data">
<!-- HTML that describe how select should render selected items -->
<span v-if="data.item.branchName">{{ data.item.name }} - {{ data.item.branchName }}</span>
<span v-else>{{ data.item.name }}</span>
<span v-if="data.item.branchName" data-test="account-authorization-request-selection">{{ data.item.name }} - {{ data.item.branchName }}</span>
<span v-else data-test="account-authorization-request-selection">{{ data.item.name }}</span>
</template>
<template v-slot:item="data">
<span v-if="data.item.branchName">{{ data.item.name }} - {{ data.item.branchName }}</span>
<span v-else>{{ data.item.name }}</span>
<span v-if="data.item.branchName" data-test="account-authorization-request-option">{{ data.item.name }} - {{ data.item.branchName }}</span>
<span v-else data-test="account-authorization-request-option">{{ data.item.name }}</span>
</template>
</v-select>
<span>You can add a message that will be included as part of your authorization request. </span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Vuetify from 'vuetify'
import { axios } from '@/util/http-util'
import flushPromises from 'flush-promises'
import sinon from 'sinon'
import { expect } from 'vitest'

const vuetify = new Vuetify({})

Expand Down Expand Up @@ -85,10 +86,9 @@ describe('AccountAuthorizationRequest tests', () => {

// verify that account is selected and selector disabled
expect(wrapper.find('#account-authorization-request-request-account-select').attributes().disabled).toBeDefined()
expect(wrapper.find('.v-select__selection--comma').text())
.toBe(orgsDetailsByAffiliationSingleItemResponse.orgsDetails[0].name)
expect(wrapper.findAll('.v-list-item__title').length ===
orgsDetailsByAffiliationSingleItemResponse.orgsDetails.length)
expect(wrapper.find('[data-test="account-authorization-request-selection"]').text())
.toContain(orgsDetailsByAffiliationSingleItemResponse.orgsDetails[0].name)
expect(wrapper.findAll('[data-test="account-authorization-request-option"]').exists()).toBe(false)
})

it('renders enabled select with no preselected item, when multiple affiliated accounts found', async () => {
Expand All @@ -104,7 +104,7 @@ describe('AccountAuthorizationRequest tests', () => {

// verify that account is selected and selector disabled
expect(wrapper.find('#account-authorization-request-request-account-select').attributes().disabled).toBeUndefined()
expect(wrapper.findAll('.v-list-item__title').length ===
console.assert(wrapper.findAll('[data-test="account-authorization-request-option"]').length ===
orgsDetailsByAffiliationMultipleItemsResponse.orgsDetails.length)
})
})

0 comments on commit 8a9c8a7

Please sign in to comment.