From e211e26d16f604dec5337fae2f3afb35ef9294ca Mon Sep 17 00:00:00 2001
From: Angelina Filippova <linakirsanova@gmail.com>
Date: Sat, 6 Jun 2020 22:33:08 +0300
Subject: [PATCH] Fix tests

---
 src/api/__mocks__/reports.js      | 18 +++++++++---------
 src/api/__mocks__/status.js       |  6 +++---
 src/api/__mocks__/users.js        |  2 +-
 test/views/statuses/index.test.js |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/api/__mocks__/reports.js b/src/api/__mocks__/reports.js
index 5c6fe3a1..5d2e2097 100644
--- a/src/api/__mocks__/reports.js
+++ b/src/api/__mocks__/reports.js
@@ -1,14 +1,14 @@
 const reports = [
-  { created_at: '2019-05-21T21:35:33.000Z', account: { display_name: 'Benjamin Fame', tags: [] }, actor: {}, state: 'open', id: '2', content: 'This is a report', statuses: [] },
-  { created_at: '2019-05-20T22:45:33.000Z', account: { display_name: 'Alice Pool', tags: [] }, actor: {}, state: 'resolved', id: '1', content: 'Please block this user', statuses: [] },
-  { created_at: '2019-05-18T13:01:33.000Z', account: { display_name: 'Nick Keys', tags: [] }, actor: {}, state: 'closed', id: '3', content: '', statuses: [] },
-  { created_at: '2019-05-21T21:35:33.000Z', account: { display_name: 'Benjamin Fame', tags: [] }, actor: {}, state: 'open', id: '5', content: 'This is a report', statuses: [] },
-  { created_at: '2019-05-20T22:45:33.000Z', account: { display_name: 'Alice Pool', tags: [] }, actor: {}, state: 'resolved', id: '7', content: 'Please block this user', statuses: [
-    { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'public', sensitive: false, id: '11', content: 'Hey!', url: '', created_at: '2019-05-10T21:35:33.000Z' },
-    { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'unlisted', sensitive: true, id: '10', content: 'Bye!', url: '', created_at: '2019-05-10T21:00:33.000Z' }
+  { created_at: '2019-05-21T21:35:33.000Z', account: { nickname: 'benjamin', tags: [] }, actor: {}, state: 'open', id: '2', content: 'This is a report', statuses: [] },
+  { created_at: '2019-05-20T22:45:33.000Z', account: { nickname: 'alice', tags: [] }, actor: {}, state: 'resolved', id: '1', content: 'Please block this user', statuses: [] },
+  { created_at: '2019-05-18T13:01:33.000Z', account: { nickname: 'nick_keys', tags: [] }, actor: {}, state: 'closed', id: '3', content: '', statuses: [] },
+  { created_at: '2019-05-21T21:35:33.000Z', account: { nickname: 'benjamin', tags: [] }, actor: {}, state: 'open', id: '5', content: 'This is a report', statuses: [] },
+  { created_at: '2019-05-20T22:45:33.000Z', account: { nickname: 'alice', tags: [] }, actor: {}, state: 'resolved', id: '7', content: 'Please block this user', statuses: [
+    { account: { nickname: 'alice', avatar: '' }, visibility: 'public', sensitive: false, id: '11', content: 'Hey!', url: '', created_at: '2019-05-10T21:35:33.000Z' },
+    { account: { nickname: 'alice', avatar: '' }, visibility: 'unlisted', sensitive: true, id: '10', content: 'Bye!', url: '', created_at: '2019-05-10T21:00:33.000Z' }
   ] },
-  { created_at: '2019-05-18T13:01:33.000Z', account: { display_name: 'Nick Keys', tags: [] }, actor: {}, state: 'closed', id: '6', content: '', statuses: [] },
-  { created_at: '2019-05-18T13:01:33.000Z', account: { display_name: 'Nick Keys', tags: [] }, actor: {}, state: 'closed', id: '4', content: '', statuses: [] }
+  { created_at: '2019-05-18T13:01:33.000Z', account: { nickname: 'nick_keys', tags: [] }, actor: {}, state: 'closed', id: '6', content: '', statuses: [] },
+  { created_at: '2019-05-18T13:01:33.000Z', account: { nickname: 'nick_keys', tags: [] }, actor: {}, state: 'closed', id: '4', content: '', statuses: [] }
 ]
 
 export async function fetchReports(filter, page, pageSize, authHost, token) {
diff --git a/src/api/__mocks__/status.js b/src/api/__mocks__/status.js
index c8f98545..ec5271cc 100644
--- a/src/api/__mocks__/status.js
+++ b/src/api/__mocks__/status.js
@@ -13,7 +13,7 @@ export async function fetchStatusesByInstance({ instance, authHost, token, pageS
       ? [{
         'account': {
           'avatar': 'http://localhost:4000/images/avi.png',
-          'display_name': 'sky',
+          'nickname': 'sky',
           'url': 'http://localhost:4000/users/sky'
         },
         'content': 'A nice young couple contacted us from Brazil to decorate their newly acquired apartment.',
@@ -29,7 +29,7 @@ export async function fetchStatusesByInstance({ instance, authHost, token, pageS
       {
         'account': {
           'avatar': 'http://localhost:4000/images/avi.png',
-          'display_name': 'sky',
+          'nickname': 'sky',
           'url': 'http://localhost:4000/users/sky'
         },
         'content': 'A nice young couple contacted us from Brazil to decorate their newly acquired apartment.',
@@ -42,7 +42,7 @@ export async function fetchStatusesByInstance({ instance, authHost, token, pageS
       {
         'account': {
           'avatar': 'http://localhost:4000/images/avi.png',
-          'display_name': 'sky',
+          'nickname': 'sky',
           'url': 'http://localhost:4000/users/sky'
         },
         'content': 'the happiest man ever',
diff --git a/src/api/__mocks__/users.js b/src/api/__mocks__/users.js
index 9a3afd41..3e4975ef 100644
--- a/src/api/__mocks__/users.js
+++ b/src/api/__mocks__/users.js
@@ -4,7 +4,7 @@ export let users = [
   { active: false, deactivated: true, id: 'abc', nickname: 'john', local: true, external: false, roles: { admin: false, moderator: false }, tags: ['strip_media'] }
 ]
 
-const userProfile = { avatar: 'avatar.jpg', display_name: 'Allis', nickname: 'allis', id: '2', tags: [], roles: { admin: true, moderator: false }, local: true, external: false }
+const userProfile = { avatar: 'avatar.jpg', nickname: 'allis', id: '2', tags: [], roles: { admin: true, moderator: false }, local: true, external: false }
 
 const userStatuses = []
 
diff --git a/test/views/statuses/index.test.js b/test/views/statuses/index.test.js
index e6173883..62921650 100644
--- a/test/views/statuses/index.test.js
+++ b/test/views/statuses/index.test.js
@@ -73,7 +73,7 @@ describe('Statuses', () => {
     await flushPromises()
 
     expect(wrapper.vm.selectedUsers.length).toEqual(1)
-    expect(wrapper.vm.selectedUsers[0].display_name).toBe('sky')
+    expect(wrapper.vm.selectedUsers[0].nickname).toBe('sky')
     done()
   })
 
-- 
GitLab