import {render, screen} from 'sentry-test/reactTestingLibrary';
import {getMockData} from '../testUtils';
import {AffectOtherProjectsTransactionsAlert} from './affectOtherProjectsTransactionsAlert';
describe("Affect other project's transactions alert", function () {
it('does not render', function () {
const {project} = getMockData();
const {rerender} = render(
);
expect(screen.queryByText(/This rate will affect/)).not.toBeInTheDocument(); // project is incompatible
rerender(
);
expect(screen.queryByText(/This rate will affect/)).not.toBeInTheDocument(); // there is only one affected project and it is the current project
rerender(
);
expect(screen.queryByText(/This rate will affect/)).not.toBeInTheDocument(); // there is no affected project
});
it('renders', function () {
const {projects} = getMockData();
render(
);
expect(screen.getByText(/This rate will affect/)).toBeInTheDocument();
});
});