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
8 changes: 4 additions & 4 deletions src/components/ConversationsOptionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<template>
<ul class="contacts-list">
<AppContentListItem
<ListItem
v-for="item of items"
:key="item.id"
:title="item.label"
Expand All @@ -32,20 +32,20 @@
:item="iconData(item)"
:disable-menu="true" />
</template>
</AppContentListItem>
</ListItem>
</ul>
</template>

<script>
import ConversationIcon from './ConversationIcon'
import AppContentListItem from './LeftSidebar/ConversationsList/AppContentListItem/AppContentListItem'
import ListItem from '@nextcloud/vue/dist/Components/ListItem'
import { CONVERSATION } from '../constants'

export default {
name: 'ConversationsOptionsList',
components: {
ConversationIcon,
AppContentListItem,
ListItem,
},
props: {
items: {
Expand Down

This file was deleted.

31 changes: 15 additions & 16 deletions src/components/LeftSidebar/ConversationsList/Conversation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)
expect(el.props('title')).toBe('conversation one')

Expand All @@ -109,7 +109,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.vm.$slots.subtitle[0].text.trim()).toBe(expectedText)
}

Expand Down Expand Up @@ -281,28 +281,27 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

const counter = el.vm.$slots.counter[0]
expect(counter.componentInstance.$el.textContent).toBe(expectedCounterText)
expect(counter.componentInstance.highlighted).toBe(expectedHighlighted)
expect(el.props('counterNumber')).toBe(expectedCounterText)
expect(el.props('counterHighlighted')).toBe(expectedHighlighted)
}

test('renders unread messages counter', () => {
item.unreadMessages = 5
testCounter(item, '5', false)
testCounter(item, 5, false)
})
test('renders unread mentions highlighted for non one-to-one conversations', () => {
item.unreadMessages = 5
item.unreadMention = true
testCounter(item, '5', true)
testCounter(item, 5, true)
})
test('renders unread mentions always highlighted for one-to-one conversations', () => {
item.unreadMessages = 5
item.unreadMention = false
item.type = CONVERSATION.TYPE.ONE_TO_ONE
testCounter(item, '5', true)
testCounter(item, 5, true)
})

test('does not render counter when no unread messages', () => {
Expand All @@ -318,7 +317,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

expect(el.vm.$slots.counter).not.toBeDefined()
Expand Down Expand Up @@ -359,7 +358,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

return findActionButton(el, actionName)
Expand All @@ -378,7 +377,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

await el.find('a').trigger('click')
Expand Down Expand Up @@ -524,7 +523,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

const action = findActionButton(el, 'Copy link')
Expand Down Expand Up @@ -553,7 +552,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

const action = findActionButton(el, 'Add to favorites')
Expand Down Expand Up @@ -584,7 +583,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

const action = findActionButton(el, 'Remove from favorites')
Expand Down Expand Up @@ -620,7 +619,7 @@ describe('Conversation.vue', () => {
},
})

const el = wrapper.findComponent({ name: 'AppContentListItem' })
const el = wrapper.findComponent({ name: 'ListItem' })
expect(el.exists()).toBe(true)

const actionButtons = wrapper.findAllComponents(ActionButton)
Expand Down
Loading