2023-03-02 11:40:36 -08:00
|
|
|
import React from 'react';
|
|
|
|
|
2023-03-13 12:55:59 -07:00
|
|
|
import { buildGroup } from 'soapbox/jest/factory';
|
2023-03-02 11:40:36 -08:00
|
|
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
|
|
|
import { Group } from 'soapbox/types/entities';
|
|
|
|
|
|
|
|
import GroupPrivacy from '../group-privacy';
|
|
|
|
|
|
|
|
let group: Group;
|
|
|
|
|
|
|
|
describe('<GroupPrivacy />', () => {
|
|
|
|
describe('with a Private group', () => {
|
|
|
|
beforeEach(() => {
|
2023-03-13 12:55:59 -07:00
|
|
|
group = buildGroup({
|
2023-03-02 11:40:36 -08:00
|
|
|
locked: true,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render the correct text', () => {
|
|
|
|
render(<GroupPrivacy group={group} />);
|
|
|
|
|
|
|
|
expect(screen.getByTestId('group-privacy')).toHaveTextContent('Private');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('with a Public group', () => {
|
|
|
|
beforeEach(() => {
|
2023-03-13 12:55:59 -07:00
|
|
|
group = buildGroup({
|
2023-03-02 11:40:36 -08:00
|
|
|
locked: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render the correct text', () => {
|
|
|
|
render(<GroupPrivacy group={group} />);
|
|
|
|
|
|
|
|
expect(screen.getByTestId('group-privacy')).toHaveTextContent('Public');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|