Skip to content
Snippets Groups Projects
Commit e211e26d authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Fix tests

parent 727f72f0
No related branches found
No related tags found
1 merge request!133Update displaying and managing accounts with invalid nicknames
This commit is part of merge request !133. Comments created here will be created in the context of that merge request.
const reports = [ 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-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: { display_name: 'Alice Pool', tags: [] }, actor: {}, state: 'resolved', id: '1', content: 'Please block this user', 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: { display_name: 'Nick Keys', tags: [] }, actor: {}, state: 'closed', id: '3', content: '', 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: { display_name: 'Benjamin Fame', tags: [] }, actor: {}, state: 'open', id: '5', content: 'This is a report', 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: { display_name: 'Alice Pool', tags: [] }, actor: {}, state: 'resolved', id: '7', content: 'Please block this user', 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: { display_name: 'Alice Pool', avatar: '' }, visibility: 'public', sensitive: false, id: '11', content: 'Hey!', url: '', created_at: '2019-05-10T21:35:33.000Z' }, { account: { nickname: 'alice', 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' } { 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: { nickname: '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: '4', content: '', statuses: [] }
] ]
export async function fetchReports(filter, page, pageSize, authHost, token) { export async function fetchReports(filter, page, pageSize, authHost, token) {
......
...@@ -13,7 +13,7 @@ export async function fetchStatusesByInstance({ instance, authHost, token, pageS ...@@ -13,7 +13,7 @@ export async function fetchStatusesByInstance({ instance, authHost, token, pageS
? [{ ? [{
'account': { 'account': {
'avatar': 'http://localhost:4000/images/avi.png', 'avatar': 'http://localhost:4000/images/avi.png',
'display_name': 'sky', 'nickname': 'sky',
'url': 'http://localhost:4000/users/sky' 'url': 'http://localhost:4000/users/sky'
}, },
'content': 'A nice young couple contacted us from Brazil to decorate their newly acquired apartment.', '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 ...@@ -29,7 +29,7 @@ export async function fetchStatusesByInstance({ instance, authHost, token, pageS
{ {
'account': { 'account': {
'avatar': 'http://localhost:4000/images/avi.png', 'avatar': 'http://localhost:4000/images/avi.png',
'display_name': 'sky', 'nickname': 'sky',
'url': 'http://localhost:4000/users/sky' 'url': 'http://localhost:4000/users/sky'
}, },
'content': 'A nice young couple contacted us from Brazil to decorate their newly acquired apartment.', '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 ...@@ -42,7 +42,7 @@ export async function fetchStatusesByInstance({ instance, authHost, token, pageS
{ {
'account': { 'account': {
'avatar': 'http://localhost:4000/images/avi.png', 'avatar': 'http://localhost:4000/images/avi.png',
'display_name': 'sky', 'nickname': 'sky',
'url': 'http://localhost:4000/users/sky' 'url': 'http://localhost:4000/users/sky'
}, },
'content': 'the happiest man ever', 'content': 'the happiest man ever',
......
...@@ -4,7 +4,7 @@ export let users = [ ...@@ -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'] } { 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 = [] const userStatuses = []
......
...@@ -73,7 +73,7 @@ describe('Statuses', () => { ...@@ -73,7 +73,7 @@ describe('Statuses', () => {
await flushPromises() await flushPromises()
expect(wrapper.vm.selectedUsers.length).toEqual(1) 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() done()
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment