Fix status test

This commit is contained in:
Alex Gleason 2023-06-26 12:41:42 -05:00
parent a8792f9a02
commit 64df93f5a0
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,12 +1,14 @@
import React from 'react'; import React from 'react';
import { render, screen, rootState } from '../../jest/test-helpers'; import { buildAccount } from 'soapbox/jest/factory';
import { normalizeStatus, normalizeAccount } from '../../normalizers'; import { render, screen, rootState } from 'soapbox/jest/test-helpers';
import { normalizeStatus } from 'soapbox/normalizers';
import Status from '../status'; import Status from '../status';
import type { ReducerStatus } from 'soapbox/reducers/statuses'; import type { ReducerStatus } from 'soapbox/reducers/statuses';
const account = normalizeAccount({ const account = buildAccount({
id: '1', id: '1',
acct: 'alex', acct: 'alex',
}); });
@ -34,7 +36,7 @@ describe('<Status />', () => {
}); });
it('is not rendered if status is under review', () => { it('is not rendered if status is under review', () => {
const inReviewStatus = normalizeStatus({ ...status, visibility: 'self' }); const inReviewStatus = status.set('visibility', 'self');
render(<Status status={inReviewStatus as ReducerStatus} />, undefined, state); render(<Status status={inReviewStatus as ReducerStatus} />, undefined, state);
expect(screen.queryAllByTestId('status-action-bar')).toHaveLength(0); expect(screen.queryAllByTestId('status-action-bar')).toHaveLength(0);
}); });