diff --git a/src/api/__mocks__/reports.js b/src/api/__mocks__/reports.js index ccb83064..43df97e7 100644 --- a/src/api/__mocks__/reports.js +++ b/src/api/__mocks__/reports.js @@ -4,8 +4,8 @@ const reports = [ { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys' }, actor: { acct: 'admin' }, state: 'closed', id: '3', content: '', statuses: [] }, { created_at: '2019-05-21T21:35:33.000Z', account: { acct: 'benj', display_name: 'Benjamin Fame' }, actor: { acct: 'admin' }, state: 'open', id: '5', content: 'This is a report', statuses: [] }, { created_at: '2019-05-20T22:45:33.000Z', account: { acct: 'alice', display_name: 'Alice Pool' }, actor: { acct: 'admin2' }, 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' } + { 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-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys' }, actor: { acct: 'admin' }, state: 'closed', id: '6', content: '', statuses: [] }, { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys' }, actor: { acct: 'admin' }, state: 'closed', id: '4', content: '', statuses: [] } @@ -31,3 +31,7 @@ export async function changeStatusScope(id, sensitive, visibility, authHost, tok const status = reports[4].statuses[0] return Promise.resolve({ data: { ...status, sensitive, visibility }}) } + +export async function deleteStatus(statusId, authHost, token) { + return Promise.resolve() +} diff --git a/test/views/reports/timelineItem.test.js b/test/views/reports/timelineItem.test.js index 551394de..6e3b9f01 100644 --- a/test/views/reports/timelineItem.test.js +++ b/test/views/reports/timelineItem.test.js @@ -144,4 +144,14 @@ describe('Report in a timeline', () => { expect(store.state.reports.fetchedReports[4].statuses[1].visibility).toEqual('private') done() }) + + it('deletes a status', async (done) => { + const report = store.state.reports.fetchedReports[4] + expect(report.statuses.length).toEqual(2) + + store.dispatch('DeleteStatus', { statusId: '11', reportId: '7'}) + await flushPromises() + expect(store.state.reports.fetchedReports[4].statuses.length).toEqual(1) + done() + }) })