mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #2390 from gradido/closeAllOpenCollapse-in-methodes-getListContributionMessages
fix(frontend): load contributionMessages is fixed
This commit is contained in:
commit
cc1aea0be1
@ -67,9 +67,9 @@ describe('ContributionMessagesFormular', () => {
|
||||
await wrapper.find('form').trigger('submit')
|
||||
})
|
||||
|
||||
it('emitted "get-list-contribution-messages" with data', async () => {
|
||||
it('emitted "get-list-contribution-messages" with false', async () => {
|
||||
expect(wrapper.emitted('get-list-contribution-messages')).toEqual(
|
||||
expect.arrayContaining([expect.arrayContaining([42])]),
|
||||
expect.arrayContaining([expect.arrayContaining([false])]),
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ export default {
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
this.$emit('get-list-contribution-messages', this.contributionId)
|
||||
this.$emit('get-list-contribution-messages', false)
|
||||
this.$emit('update-state', this.contributionId)
|
||||
this.form.text = ''
|
||||
this.toastSuccess(this.$t('message.reply'))
|
||||
|
||||
@ -40,16 +40,6 @@ describe('ContributionMessagesList', () => {
|
||||
expect(wrapper.findComponent({ name: 'ContributionMessagesFormular' }).exists()).toBe(true)
|
||||
})
|
||||
|
||||
describe('get List Contribution Messages', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.vm.getListContributionMessages()
|
||||
})
|
||||
|
||||
it('emits getListContributionMessages', async () => {
|
||||
expect(wrapper.vm.$emit('get-list-contribution-messages')).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
||||
describe('update State', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.vm.updateState()
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<contribution-messages-formular
|
||||
v-if="['PENDING', 'IN_PROGRESS'].includes(state)"
|
||||
:contributionId="contributionId"
|
||||
@get-list-contribution-messages="getListContributionMessages"
|
||||
v-on="$listeners"
|
||||
@update-state="updateState"
|
||||
/>
|
||||
</b-container>
|
||||
@ -50,9 +50,6 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getListContributionMessages() {
|
||||
this.$emit('get-list-contribution-messages', this.contributionId)
|
||||
},
|
||||
updateState(id) {
|
||||
this.$emit('update-state', id)
|
||||
},
|
||||
|
||||
@ -9,6 +9,7 @@ describe('ContributionListItem', () => {
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$d: jest.fn((d) => d),
|
||||
$apollo: { query: jest.fn().mockResolvedValue() },
|
||||
}
|
||||
|
||||
const propsData = {
|
||||
@ -143,5 +144,16 @@ describe('ContributionListItem', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('getListContributionMessages', () => {
|
||||
beforeEach(() => {
|
||||
wrapper
|
||||
.findComponent({ name: 'ContributionMessagesList' })
|
||||
.vm.$emit('get-list-contribution-messages')
|
||||
})
|
||||
it('emits closeAllOpenCollapse', () => {
|
||||
expect(wrapper.emitted('closeAllOpenCollapse')).toBeTruthy()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
v-b-toggle="collapsId"
|
||||
icon="chat-dots"
|
||||
class="h2 mr-5"
|
||||
@click="$emit('closeAllOpenCollapse'), getListContributionMessages"
|
||||
@click="getListContributionMessages"
|
||||
></b-icon>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,7 +65,7 @@
|
||||
v-if="state === 'IN_PROGRESS'"
|
||||
v-b-toggle="collapsId"
|
||||
variant="warning"
|
||||
@click="$emit('closeAllOpenCollapse'), getListContributionMessages"
|
||||
@click="getListContributionMessages"
|
||||
>
|
||||
{{ $t('contribution.alert.answerQuestion') }}
|
||||
</b-button>
|
||||
@ -179,8 +179,10 @@ export default {
|
||||
if (value) this.$emit('delete-contribution', item)
|
||||
})
|
||||
},
|
||||
getListContributionMessages() {
|
||||
// console.log('getListContributionMessages', this.contributionId)
|
||||
getListContributionMessages(closeCollapse = true) {
|
||||
if (closeCollapse) {
|
||||
this.$emit('closeAllOpenCollapse')
|
||||
}
|
||||
this.$apollo
|
||||
.query({
|
||||
query: listContributionMessages,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user