Add test
This commit is contained in:
parent
6bdc9b4d2f
commit
e2b0994780
1 changed files with 22 additions and 0 deletions
|
@ -59,6 +59,28 @@ describe('compose reducer', () => {
|
||||||
const result = reducer(undefined, action);
|
const result = reducer(undefined, action);
|
||||||
expect(result.getIn(['media_attachments', 0, 'id'])).toEqual('508107650');
|
expect(result.getIn(['media_attachments', 0, 'id'])).toEqual('508107650');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('sets the id when editing a post', () => {
|
||||||
|
const action = {
|
||||||
|
withRedraft: false,
|
||||||
|
type: actions.COMPOSE_SET_STATUS,
|
||||||
|
status: normalizeStatus(fromJS(require('soapbox/__fixtures__/pleroma-status-deleted.json'))),
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = reducer(undefined, action);
|
||||||
|
expect(result.get('id')).toEqual('AHU2RrX0wdcwzCYjFQ');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not set the id when redrafting a post', () => {
|
||||||
|
const action = {
|
||||||
|
withRedraft: true,
|
||||||
|
type: actions.COMPOSE_SET_STATUS,
|
||||||
|
status: normalizeStatus(fromJS(require('soapbox/__fixtures__/pleroma-status-deleted.json'))),
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = reducer(undefined, action);
|
||||||
|
expect(result.get('id')).toEqual(null);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses \'public\' scope as default', () => {
|
it('uses \'public\' scope as default', () => {
|
||||||
|
|
Loading…
Reference in a new issue