@@ -46,39 +46,21 @@ module('Integration | Component | user-status-modal', function (hooks) {
4646 } ) ;
4747
4848 test ( 'payload contains relevant data when status is changed to OOO' , async function ( assert ) {
49- assert . expect ( 6 ) ;
49+ assert . expect ( 4 ) ;
5050 this . setProperties ( {
5151 newStatus : 'OOO' ,
5252 showUserStateModal : true ,
5353 toggleUserStateModal : ( ) => {
5454 this . set ( 'showUserStateModal' , ! this . showUserStateModal ) ;
5555 } ,
56- updateStatus : ( statusPayLoad ) => {
57- const {
58- currentStatus : { state, from, until, message, updatedAt } ,
59- } = statusPayLoad ;
60- console . log ( 'Payload:' , JSON . stringify ( statusPayLoad , null , 2 ) ) ;
61- assert . strictEqual ( state , 'OOO' , 'New state is present in the payload' ) ;
56+ createOOORequest : ( from , until , reason ) => {
6257 assert . strictEqual (
63- message ,
58+ reason ,
6459 'OOO due to Bad Health' ,
65- 'Message is present in the payload' ,
66- ) ;
67- assert . strictEqual (
68- typeof from ,
69- 'number' ,
70- 'From is a numeric timestamp' ,
71- ) ;
72- assert . strictEqual (
73- typeof until ,
74- 'number' ,
75- 'Until is a numeric timestamp' ,
76- ) ;
77- assert . strictEqual (
78- typeof updatedAt ,
79- 'number' ,
80- 'UpdatedAt is a numeric timestamp' ,
60+ 'Reason is present in the payload' ,
8161 ) ;
62+ assert . strictEqual ( typeof from , 'string' , 'From is a date string' ) ;
63+ assert . strictEqual ( typeof until , 'string' , 'Until is a date string' ) ;
8264 } ,
8365 } ) ;
8466 await render ( hbs `
@@ -87,6 +69,7 @@ module('Integration | Component | user-status-modal', function (hooks) {
8769 @newStatus={{this.newStatus}}
8870 @toggleUserStateModal={{this.toggleUserStateModal}}
8971 @updateStatus={{this.updateStatus}}
72+ @createOOORequest={{this.createOOORequest}}
9073 />
9174 ` ) ;
9275
@@ -125,7 +108,6 @@ module('Integration | Component | user-status-modal', function (hooks) {
125108 newStatus : 'OOO' ,
126109 showUserStateModal : true ,
127110 isStatusUpdating : false ,
128- isDevMode : true ,
129111 createOOORequest : ( ) => { } ,
130112 } ) ;
131113
@@ -136,7 +118,6 @@ module('Integration | Component | user-status-modal', function (hooks) {
136118 @toggleUserStateModal={{this.toggleUserStateModal}}
137119 @updateStatus={{this.updateStatus}}
138120 @isStatusUpdating={{this.isStatusUpdating}}
139- @dev={{this.isDevMode}}
140121 @createOOORequest={{this.createOOORequest}}
141122 />
142123 ` ) ;
0 commit comments