pleroma/app/soapbox/features/ui/components/__tests__/subscribe-button.test.tsx

27 lines
737 B
TypeScript
Raw Normal View History

2022-06-14 08:58:42 -07:00
import React from 'react';
2023-06-20 12:24:39 -07:00
import { buildAccount, buildRelationship } from 'soapbox/jest/factory';
2023-05-02 16:49:13 -07:00
import { render, screen } from 'soapbox/jest/test-helpers';
2022-06-14 08:58:42 -07:00
import SubscribeButton from '../subscription-button';
2022-07-06 10:16:14 -07:00
const justin = {
2022-06-14 08:58:42 -07:00
id: '1',
acct: 'justin-username',
display_name: 'Justin L',
avatar: 'test.jpg',
};
describe('<SubscribeButton />', () => {
2022-07-06 10:16:14 -07:00
let store: any;
2022-06-14 08:58:42 -07:00
describe('with "accountNotifies" disabled', () => {
it('renders nothing', () => {
2023-06-20 12:24:39 -07:00
const account = buildAccount({ ...justin, relationship: buildRelationship({ following: true }) });
2022-06-14 08:58:42 -07:00
2022-07-06 10:16:14 -07:00
render(<SubscribeButton account={account} />, undefined, store);
2022-06-14 08:58:42 -07:00
expect(screen.queryAllByTestId('icon-button')).toHaveLength(0);
});
});
});