File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { EndpointEvent } from '../../../models/endpoint-event' ;
2+ import { EndpointStatusEnum } from '../../../models/endpoint-status-enum' ;
3+ import { EndpointTypeEnum } from '../../../models/endpoint-type-enum' ;
4+
5+ describe ( 'EndpointEvent' , ( ) => {
6+ test ( 'should create an endpoint event with all fields' , ( ) => {
7+ const event : EndpointEvent = {
8+ endpointId : 'ep-123456' ,
9+ type : EndpointTypeEnum . Webrtc ,
10+ status : EndpointStatusEnum . Connected ,
11+ creationTimestamp : '2024-02-18T10:30:00Z' ,
12+ expirationTimestamp : '2024-02-19T10:30:00Z' ,
13+ tag : 'test-event'
14+ } ;
15+
16+ expect ( event . endpointId ) . toBe ( 'ep-123456' ) ;
17+ expect ( event . type ) . toBe ( 'WEBRTC' ) ;
18+ expect ( event . status ) . toBe ( 'CONNECTED' ) ;
19+ expect ( new Date ( event . creationTimestamp ) . getFullYear ( ) ) . toBe ( 2024 ) ;
20+ expect ( new Date ( event . creationTimestamp ) . toISOString ( ) ) . toBe ( '2024-02-18T10:30:00.000Z' ) ;
21+ expect ( new Date ( event . expirationTimestamp ) . getFullYear ( ) ) . toBe ( 2024 ) ;
22+ expect ( new Date ( event . expirationTimestamp ) . toISOString ( ) ) . toBe ( '2024-02-19T10:30:00.000Z' ) ;
23+ expect ( event . tag ) . toBe ( 'test-event' ) ;
24+ } ) ;
25+ } ) ;
You can’t perform that action at this time.
0 commit comments