Fix broken tests.
This commit is contained in:
		
							parent
							
								
									7eb9384bd6
								
							
						
					
					
						commit
						8b6aeddcd6
					
				| @ -84,12 +84,13 @@ mod tests { | ||||
|                 displayname: None, | ||||
|                 last_active_ago: Some(2_478_593), | ||||
|                 presence: PresenceState::Online, | ||||
|                 status_msg: Some("Making cupcakes".to_string()), | ||||
|             }, | ||||
|             event_type: EventType::Presence, | ||||
|             sender: UserId::try_from("@example:localhost").unwrap(), | ||||
|         }; | ||||
|         let serialized_event = | ||||
|             r#"{"content":{"avatar_url":"mxc://localhost:wefuiwegh8742w","currently_active":false,"last_active_ago":2478593,"presence":"online"},"type":"m.presence","sender":"@example:localhost"}"#; | ||||
|             r#"{"content":{"avatar_url":"mxc://localhost:wefuiwegh8742w","currently_active":false,"last_active_ago":2478593,"presence":"online","status_msg":"Making cupcakes"},"type":"m.presence","sender":"@example:localhost"}"#; | ||||
| 
 | ||||
|         assert_eq!(to_string(&event).unwrap(), serialized_event); | ||||
|         let deserialized_event = from_str::<PresenceEvent>(serialized_event).unwrap(); | ||||
|  | ||||
| @ -358,11 +358,11 @@ mod tests { | ||||
|             StrippedState::RoomAvatar(event) => { | ||||
|                 let image_info = event.content.info.unwrap(); | ||||
| 
 | ||||
|                 assert_eq!(image_info.height, 128); | ||||
|                 assert_eq!(image_info.width, 128); | ||||
|                 assert_eq!(image_info.mimetype, "image/jpeg"); | ||||
|                 assert_eq!(image_info.size, 1024); | ||||
|                 assert_eq!(image_info.thumbnail_info.unwrap().size, 32); | ||||
|                 assert_eq!(image_info.height.unwrap(), 128); | ||||
|                 assert_eq!(image_info.width.unwrap(), 128); | ||||
|                 assert_eq!(image_info.mimetype.unwrap(), "image/jpeg"); | ||||
|                 assert_eq!(image_info.size.unwrap(), 1024); | ||||
|                 assert_eq!(image_info.thumbnail_info.unwrap().size.unwrap(), 32); | ||||
|                 assert_eq!(event.content.url, "https://domain.com/image.jpg"); | ||||
|                 assert_eq!(event.event_type, EventType::RoomAvatar); | ||||
|                 assert_eq!(event.state_key, ""); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user