File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 11const axios = require ( 'axios' ) ;
22const { queryOptions, calendarData } = require ( '../src/utils' ) ;
33const { createGraph } = require ( '../src/createChart' ) ;
4+ const { graphSvg, invalidUserSvg } = require ( '../src/svgs' ) ;
45
56const {
67 fakeQueryString,
78 fakeQueryStringRes,
9+ fakeGraphArgs,
810 options,
911} = require ( './inputs.index' ) ;
1012
@@ -34,3 +36,11 @@ it('Graph Generation', async () =>{
3436} ) ;
3537expect ( graph ) . toEqual ( expect . any ( String ) ) ;
3638} ) ;
39+
40+ //- Svg testing ✔
41+ it ( 'Test SVGs' , ( ) => {
42+ let fakeInvalidSvgArg = 'User not found!' ;
43+ expect . assertions ( 2 ) ;
44+ expect ( graphSvg ( fakeGraphArgs ) ) . toEqual ( expect . any ( String ) ) ;
45+ expect ( invalidUserSvg ( fakeInvalidSvgArg ) ) . toEqual ( expect . any ( String ) ) ;
46+ } ) ;
Original file line number Diff line number Diff line change @@ -97,6 +97,14 @@ let fakeQueryStringRes = [
9797} ,
9898] ;
9999
100+ let fakeGraphArgs = {
101+ height : 10 ,
102+ width : 20 ,
103+ colors : 'red' ,
104+ title : 'graphSvg' ,
105+ line : 'line' ,
106+ } ;
107+
100108let options = {
101109width : this . width ,
102110height : this . height ,
@@ -125,4 +133,9 @@ let options ={
125133fullWidth : true ,
126134} ;
127135
128- module . exports = { fakeQueryString, fakeQueryStringRes, options } ;
136+ module . exports = {
137+ fakeQueryString,
138+ fakeQueryStringRes,
139+ fakeGraphArgs,
140+ options,
141+ } ;
You can’t perform that action at this time.
0 commit comments