2022-05-10 03:17:01 -07:00
|
|
|
import { Map as ImmutableMap } from 'immutable';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { render, screen } from '../../../../jest/test-helpers';
|
|
|
|
import CtaBanner from '../cta-banner';
|
|
|
|
|
|
|
|
describe('<CtaBanner />', () => {
|
|
|
|
it('renders the banner', () => {
|
|
|
|
render(<CtaBanner />);
|
|
|
|
expect(screen.getByTestId('cta-banner')).toHaveTextContent(/sign up/i);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('with a logged in user', () => {
|
|
|
|
it('renders empty', () => {
|
|
|
|
const store = { me: true };
|
|
|
|
|
2022-07-06 10:16:14 -07:00
|
|
|
render(<CtaBanner />, undefined, store);
|
2022-05-10 03:17:01 -07:00
|
|
|
expect(screen.queryAllByTestId('cta-banner')).toHaveLength(0);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('with singleUserMode enabled', () => {
|
|
|
|
it('renders empty', () => {
|
|
|
|
const store = { soapbox: ImmutableMap({ singleUserMode: true }) };
|
|
|
|
|
2022-07-06 10:16:14 -07:00
|
|
|
render(<CtaBanner />, undefined, store);
|
2022-05-10 03:17:01 -07:00
|
|
|
expect(screen.queryAllByTestId('cta-banner')).toHaveLength(0);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|