mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
quick fix tests relying on classes of child components
changing class names in the UserTeaser leads to tests failing for other components, like SearchableInput and NotificationsTable – I just updated the classes but long-term it would be good to find a way to not rely on implementation details of child components – maybe just test if the child component is rendered?
This commit is contained in:
parent
287e9ce484
commit
24898f5fe2
@ -89,8 +89,8 @@ describe('NotificationsTable.vue', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('renders the author', () => {
|
it('renders the author', () => {
|
||||||
const username = firstRowNotification.find('.username')
|
const userinfo = firstRowNotification.find('.user-teaser > .info')
|
||||||
expect(username.text()).toEqual(postNotification.from.author.name)
|
expect(userinfo.text()).toContain(postNotification.from.author.name)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders the reason for the notification', () => {
|
it('renders the reason for the notification', () => {
|
||||||
@ -122,8 +122,8 @@ describe('NotificationsTable.vue', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('renders the author', () => {
|
it('renders the author', () => {
|
||||||
const username = secondRowNotification.find('.username')
|
const userinfo = secondRowNotification.find('.user-teaser > .info')
|
||||||
expect(username.text()).toEqual(commentNotification.from.author.name)
|
expect(userinfo.text()).toContain(commentNotification.from.author.name)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders the reason for the notification', () => {
|
it('renders the reason for the notification', () => {
|
||||||
|
|||||||
@ -19,11 +19,7 @@
|
|||||||
<!-- Content Column -->
|
<!-- Content Column -->
|
||||||
<td class="ds-table-col" data-test="report-content">
|
<td class="ds-table-col" data-test="report-content">
|
||||||
<client-only v-if="isUser">
|
<client-only v-if="isUser">
|
||||||
<user-teaser
|
<user-teaser :user="report.resource" :showAvatar="false" :showPopover="false" />
|
||||||
:user="report.resource"
|
|
||||||
:showAvatar="false"
|
|
||||||
:showPopover="false"
|
|
||||||
/>
|
|
||||||
</client-only>
|
</client-only>
|
||||||
<nuxt-link v-else class="title" :to="linkTarget">
|
<nuxt-link v-else class="title" :to="linkTarget">
|
||||||
{{ linkText | truncate(50) }}
|
{{ linkText | truncate(50) }}
|
||||||
@ -33,11 +29,7 @@
|
|||||||
<!-- Author Column -->
|
<!-- Author Column -->
|
||||||
<td class="ds-table-col" data-test="report-author">
|
<td class="ds-table-col" data-test="report-author">
|
||||||
<client-only v-if="!isUser">
|
<client-only v-if="!isUser">
|
||||||
<user-teaser
|
<user-teaser :user="report.resource.author" :showAvatar="false" :showPopover="false" />
|
||||||
:user="report.resource.author"
|
|
||||||
:showAvatar="false"
|
|
||||||
:showPopover="false"
|
|
||||||
/>
|
|
||||||
</client-only>
|
</client-only>
|
||||||
<span v-else>—</span>
|
<span v-else>—</span>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -97,7 +97,7 @@ describe('SearchableInput.vue', () => {
|
|||||||
it("pushes to user's profile", async () => {
|
it("pushes to user's profile", async () => {
|
||||||
select.element.value = 'Bob'
|
select.element.value = 'Bob'
|
||||||
select.trigger('input')
|
select.trigger('input')
|
||||||
const users = wrapper.findAll('.user-slug')
|
const users = wrapper.findAll('.slug')
|
||||||
const bob = users.filter(item => item.text().match(/@bob-der-baumeister/))
|
const bob = users.filter(item => item.text().match(/@bob-der-baumeister/))
|
||||||
bob.trigger('click')
|
bob.trigger('click')
|
||||||
await Vue.nextTick()
|
await Vue.nextTick()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user