Skip to content

Commit

Permalink
fix event card test
Browse files Browse the repository at this point in the history
  • Loading branch information
doug0102 committed Mar 17, 2024
1 parent a82b91c commit da3e727
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { EventCardComponent } from './event-card.component';
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { TypescriptLoader } from 'src/app/core/helpers/typescript-loader';
import { Location } from 'src/app/core/models/location.model';
import { Person } from 'src/app/core/models/person.model';
import { Group } from 'src/app/features/groups/models/group';
import { Event } from '../../models/event';

describe('EventCardComponent', () => {
let component: EventCardComponent;
Expand Down Expand Up @@ -31,6 +35,32 @@ describe('EventCardComponent', () => {
translateService = TestBed.inject(TranslateService);
fixture = TestBed.createComponent(EventCardComponent);
component = fixture.componentInstance;
const event = new Event();
component.model = {
id: '0',
title: 'Test Event',
eventType: 'Hybrid',
description: 'Test Event Description',
location: new Location('123 Main St.', 'Ottawa', 'Ontario'),
language: 'English',
tags: [''],
startDate: new Date(),
endDate: new Date(),
author: new Person('0', 'Shea', 'Dougherty-Gill', 'Web Developer', new Location('123 Main St.', 'Ottawa', 'Ontario')),
authoredDate: new Date(),
canceled: false,
image: '../assets/image/group-banner.png',
group: new Group('0', 'Test Group', '../assets/image/group-banner.png'),
displayPicture: '../assets/image/group-banner.png',
organizer: 'Test Organizer',
onlinePlatform: 'Teams',
duration: 'Single',
confirmed: false,
declined: false,
toEventForm: event.toEventForm,
fromEventForm: event.fromEventForm
};

fixture.detectChanges();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TooltipDirection } from 'src/app/shared/models/tooltip-direction';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CalendarButtonComponent {
@Input({ required: true }) date!: Date;
@Input({ required: true }) date: Date = new Date();
@Input() tooltip: string = '';
@Input() aria: string = '';
@Input() tooltipDirection: TooltipDirection = TooltipDirection.Above;
Expand Down

0 comments on commit da3e727

Please sign in to comment.