Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MPDX-8190] Render 0 instead of loading when goal is 0 #1054

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ describe('AppealHeaderInfo', () => {
expect(getByText(/\$100 \(100%\)/i)).toBeInTheDocument();
});

it('renders amount when goal is 0 info', async () => {
const { getByText, findByText } = render(
<Components appealInfo={{ ...appealInfo, amount: 0 }} loading={false} />,
);

expect(await findByText('Test Appeal')).toBeInTheDocument();

expect(getByText('$0')).toBeInTheDocument();
});

it('should allow user to open the edit appeal info modal', async () => {
const { findByText, findByRole, getByTestId, getByRole, queryByRole } =
render(<Components appealInfo={appealInfo} loading={false} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const AppealHeaderInfo: React.FC<AppealHeaderInfoProps> = ({
{t('Goal')}:
</AppealInfoHeader>
<AppealInfoContainer>
{loading || !amount ? (
{loading || !appealInfo ? (
<Skeleton
variant="text"
data-testid="appeal-goal-skeleton"
Expand Down
Loading