import React from 'react';
import { render, screen } from '@testing-library/react';
import HelloItem from '../src/components/account/HelloItem.jsx';
describe('HelloItem Component', () => {
it('should display a personalized greeting when nickname is provided', () => {
const nickname = 'JohnDoe';
const id = '12345';
render();
const greetingElement = screen.getByText(`Hello, ${nickname}!`);
const idElement = screen.getByText(`Your ID: ${id}`);
expect(greetingElement).toBeInTheDocument();
expect(idElement).toBeInTheDocument();
});
it('should display a default message when nickname is not provided', () => {
render();
const defaultMessage = screen.getByText("You don't have an account :(");
expect(defaultMessage).toBeInTheDocument();
});
});