| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | import { render } from "@testing-library/react-native"; | 
					
						
							| 
									
										
										
										
											2024-02-03 20:30:00 -07:00
										 |  |  | import React from "react"; | 
					
						
							| 
									
										
										
										
											2024-02-06 14:24:49 -08:00
										 |  |  | import LineGraph from "../../src/component/charts/line-graph/line-graph"; | 
					
						
							| 
									
										
										
										
											2024-02-06 15:08:19 -08:00
										 |  |  | import { line_chart_two_y_data } from "../mock/charts/mock-data"; | 
					
						
							| 
									
										
										
										
											2024-01-18 16:21:01 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | describe("LineGraph Component Tests", () => { | 
					
						
							|  |  |  | 	it("renders correctly with data", () => { | 
					
						
							|  |  |  | 		const { getByTestId } = render( | 
					
						
							|  |  |  | 			<LineGraph data={line_chart_two_y_data} testID="1" />, | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 		expect(getByTestId(`line-graph-1`)).toBeTruthy(); | 
					
						
							|  |  |  | 	}); | 
					
						
							| 
									
										
										
										
											2024-01-18 16:21:01 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | 	it("does not render without data", () => { | 
					
						
							|  |  |  | 		// Have to ts-ignore to test null data conditions
 | 
					
						
							|  |  |  | 		// @ts-ignore
 | 
					
						
							|  |  |  | 		const { queryByTestId } = render(<LineGraph testID="2" />); | 
					
						
							|  |  |  | 		expect(queryByTestId(`line-graph-2`)).toBeNull(); | 
					
						
							|  |  |  | 	}); | 
					
						
							| 
									
										
										
										
											2024-01-18 16:21:01 -08:00
										 |  |  | }); |