From b48e047a070f45ea4391a3413ecda0d5ce761f1d Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sun, 7 Jun 2020 00:37:28 +0300 Subject: [PATCH] Fix tests --- src/api/__mocks__/status.js | 2 +- src/api/__mocks__/users.js | 6 +++--- test/views/statuses/show.test.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/__mocks__/status.js b/src/api/__mocks__/status.js index ec727650..0fa2ccf5 100644 --- a/src/api/__mocks__/status.js +++ b/src/api/__mocks__/status.js @@ -11,7 +11,7 @@ export async function fetchStatus(id, authHost, token) { account: { id: '9n1bySks25olxWrku0', avatar: 'http://localhost:4000/images/avi.png', - display_name: 'dolin', + nickname: 'dolin', tags: ['strip_media', 'sandbox', 'disable_any_subscription', 'force_nsfw'], url: 'http://localhost:4000/users/dolin' }, diff --git a/src/api/__mocks__/users.js b/src/api/__mocks__/users.js index 99f32543..7d4172d6 100644 --- a/src/api/__mocks__/users.js +++ b/src/api/__mocks__/users.js @@ -7,9 +7,9 @@ export let users = [ const userProfile = { avatar: 'avatar.jpg', nickname: 'allis', id: '2', tags: [], roles: { admin: true, moderator: false }, local: true, external: false } const userStatuses = [ - { account: { id: '9n1bySks25olxWrku0', display_name: 'dolin' }, content: 'pizza makes everything better', id: '9vJOO3iFPyjNaEhJ5s', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' }, - { account: { id: '9n1bySks25olxWrku0', display_name: 'dolin' }, content: 'pizza time', id: '9vJPD5XKOdzQ0bvGLY', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' }, - { account: { id: '9n1bySks25olxWrku0', display_name: 'dolin' }, content: 'what is yout favorite pizza?', id: '9jop82OBXeFPYulVjM', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' } + { account: { id: '9n1bySks25olxWrku0', nickname: 'dolin' }, content: 'pizza makes everything better', id: '9vJOO3iFPyjNaEhJ5s', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' }, + { account: { id: '9n1bySks25olxWrku0', nickname: 'dolin' }, content: 'pizza time', id: '9vJPD5XKOdzQ0bvGLY', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' }, + { account: { id: '9n1bySks25olxWrku0', nickname: 'dolin' }, content: 'what is yout favorite pizza?', id: '9jop82OBXeFPYulVjM', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' } ] const filterUsers = (str) => { diff --git a/test/views/statuses/show.test.js b/test/views/statuses/show.test.js index 6bf4fdff..66da0712 100644 --- a/test/views/statuses/show.test.js +++ b/test/views/statuses/show.test.js @@ -45,7 +45,7 @@ describe('Status show page', () => { expect(wrapper.find('.status-container').isVisible()).toBe(true) expect(store.state.status.fetchedStatus.id).toBe('9vJOO3iFPyjNaEhJ5s') - expect(store.state.status.fetchedStatus.account.display_name).toBe('dolin') + expect(store.state.status.fetchedStatus.account.nickname).toBe('dolin') expect(store.state.userProfile.statuses.length).toEqual(3) done() }) @@ -81,7 +81,7 @@ describe('Status show page', () => { await flushPromises() expect(wrapper.find('.status-card').exists()).toBe(true) - expect(wrapper.find('router-link-stub h3').text()).toBe('dolin') + expect(wrapper.find('router-link-stub span.status-account-name').text()).toBe('dolin') expect(wrapper.find('span.el-tag').text()).not.toBe('Sensitive') expect(wrapper.find('span.el-tag').text()).toBe('Public') expect(wrapper.find('button.status-actions-button').exists()).toBe(true)