Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hustlernik committed Jan 15, 2025
1 parent 26fcd03 commit c0e0005
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 38 deletions.
6 changes: 0 additions & 6 deletions src/components/EventCalendar/EventCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,6 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
Events Created by Organization
</span>
</div>
{/* <div className={styles.eventsLegend}>
<span className={styles.userEvents__color}></span>
<span className={styles.legendText}>
Events Created by User
</span>
</div> */}
<div className={styles.list_container_holidays}>
<span className={styles.holidayIndicator}></span>
<span className={styles.holidayText}>Holidays</span>
Expand Down
16 changes: 13 additions & 3 deletions src/components/HolidayCards/HolidayCard.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ vi.mock('./../../style/app.module.css', () => ({
describe('HolidayCard Component', () => {
it('renders correctly with the given holiday name', () => {
const holidayName = 'Christmas';

render(<HolidayCard holidayName={holidayName} />);

// Assert that the holiday name is displayed
const cardElement = screen.getByText(holidayName);
expect(cardElement).toBeInTheDocument();
});

it('handles empty holiday name gracefully', () => {
render(<HolidayCard holidayName="" />);
const cardElement = screen.getByTestId('holiday-card');
expect(cardElement).toBeInTheDocument();
});

it('handles long holiday names appropriately', () => {
const longName = 'Very Long Holiday Name That Might Cause Wrapping Issues';
render(<HolidayCard holidayName={longName} />);
const cardElement = screen.getByText(longName);
expect(cardElement).toBeInTheDocument();
});
});
6 changes: 5 additions & 1 deletion src/components/HolidayCards/HolidayCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ interface InterfaceHolidayList {
* @returns JSX element representing a card with the holiday name.
*/
const HolidayCard = (props: InterfaceHolidayList): JSX.Element => {
return <div className={styles.holidayCard}>{props?.holidayName}</div>;
return (

Check warning on line 16 in src/components/HolidayCards/HolidayCard.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/HolidayCards/HolidayCard.tsx#L16

Added line #L16 was not covered by tests
<div className={styles.holidayCard} data-testid="holiday-card">
{props?.holidayName}
</div>
);
};

export default HolidayCard;
28 changes: 0 additions & 28 deletions src/style/app.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5811,34 +5811,6 @@ button[data-testid='createPostBtn'] {
} */
}

@media (max-width: 520px) {
.calendar__header {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 10px;
}

.space {
display: block !important;
text-align: center;
}

.space > * {
width: 100%;
margin-bottom: 10px;
}

/* .input {
width: 100%;
}
.createButton {
margin: 0 auto;
width: 100%;
} */
}

/* EventListCardModals.tsx */

.dispflexEventListCardModals {
Expand Down

0 comments on commit c0e0005

Please sign in to comment.