transformSessionsResponseToSeries.spec.tsx 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. import {
  2. SessionEmptyGroupedResponse,
  3. SessionUserCountByStatusByRelease,
  4. } from 'sentry-fixture/sessions';
  5. import {transformSessionsResponseToSeries} from 'sentry/views/dashboards/widgetCard/transformSessionsResponseToSeries';
  6. describe('transformSessionsResponseToSeries', function () {
  7. it('transforms sessions into series', () => {
  8. expect(
  9. transformSessionsResponseToSeries(SessionUserCountByStatusByRelease(), [], [])
  10. ).toEqual([
  11. {
  12. seriesName: 'crashed, 1 : sum(session)',
  13. data: [
  14. {name: '2022-01-15T00:00:00Z', value: 0},
  15. {name: '2022-01-16T00:00:00Z', value: 0},
  16. {name: '2022-01-17T00:00:00Z', value: 0},
  17. {name: '2022-01-18T00:00:00Z', value: 0},
  18. {name: '2022-01-19T00:00:00Z', value: 0},
  19. {name: '2022-01-20T00:00:00Z', value: 0},
  20. {name: '2022-01-21T00:00:00Z', value: 0},
  21. {name: '2022-01-22T00:00:00Z', value: 0},
  22. {name: '2022-01-23T00:00:00Z', value: 0},
  23. {name: '2022-01-24T00:00:00Z', value: 23},
  24. {name: '2022-01-25T00:00:00Z', value: 11},
  25. {name: '2022-01-26T00:00:00Z', value: 0},
  26. {name: '2022-01-27T00:00:00Z', value: 0},
  27. {name: '2022-01-28T00:00:00Z', value: 0},
  28. ],
  29. },
  30. {
  31. seriesName: 'crashed, 1 : count_unique(user)',
  32. data: [
  33. {name: '2022-01-15T00:00:00Z', value: 0},
  34. {name: '2022-01-16T00:00:00Z', value: 0},
  35. {name: '2022-01-17T00:00:00Z', value: 0},
  36. {name: '2022-01-18T00:00:00Z', value: 0},
  37. {name: '2022-01-19T00:00:00Z', value: 0},
  38. {name: '2022-01-20T00:00:00Z', value: 0},
  39. {name: '2022-01-21T00:00:00Z', value: 0},
  40. {name: '2022-01-22T00:00:00Z', value: 0},
  41. {name: '2022-01-23T00:00:00Z', value: 0},
  42. {name: '2022-01-24T00:00:00Z', value: 1},
  43. {name: '2022-01-25T00:00:00Z', value: 1},
  44. {name: '2022-01-26T00:00:00Z', value: 0},
  45. {name: '2022-01-27T00:00:00Z', value: 0},
  46. {name: '2022-01-28T00:00:00Z', value: 0},
  47. ],
  48. },
  49. {
  50. seriesName: 'abnormal, 1 : sum(session)',
  51. data: [
  52. {name: '2022-01-15T00:00:00Z', value: 1},
  53. {name: '2022-01-16T00:00:00Z', value: 0},
  54. {name: '2022-01-17T00:00:00Z', value: 0},
  55. {name: '2022-01-18T00:00:00Z', value: 0},
  56. {name: '2022-01-19T00:00:00Z', value: 0},
  57. {name: '2022-01-20T00:00:00Z', value: 0},
  58. {name: '2022-01-21T00:00:00Z', value: 0},
  59. {name: '2022-01-22T00:00:00Z', value: 0},
  60. {name: '2022-01-23T00:00:00Z', value: 0},
  61. {name: '2022-01-24T00:00:00Z', value: 0},
  62. {name: '2022-01-25T00:00:00Z', value: 0},
  63. {name: '2022-01-26T00:00:00Z', value: 0},
  64. {name: '2022-01-27T00:00:00Z', value: 0},
  65. {name: '2022-01-28T00:00:00Z', value: 0},
  66. ],
  67. },
  68. {
  69. seriesName: 'abnormal, 1 : count_unique(user)',
  70. data: [
  71. {name: '2022-01-15T00:00:00Z', value: 1},
  72. {name: '2022-01-16T00:00:00Z', value: 0},
  73. {name: '2022-01-17T00:00:00Z', value: 0},
  74. {name: '2022-01-18T00:00:00Z', value: 0},
  75. {name: '2022-01-19T00:00:00Z', value: 0},
  76. {name: '2022-01-20T00:00:00Z', value: 0},
  77. {name: '2022-01-21T00:00:00Z', value: 0},
  78. {name: '2022-01-22T00:00:00Z', value: 0},
  79. {name: '2022-01-23T00:00:00Z', value: 0},
  80. {name: '2022-01-24T00:00:00Z', value: 0},
  81. {name: '2022-01-25T00:00:00Z', value: 0},
  82. {name: '2022-01-26T00:00:00Z', value: 0},
  83. {name: '2022-01-27T00:00:00Z', value: 0},
  84. {name: '2022-01-28T00:00:00Z', value: 0},
  85. ],
  86. },
  87. {
  88. seriesName: 'errored, 1 : sum(session)',
  89. data: [
  90. {name: '2022-01-15T00:00:00Z', value: 0},
  91. {name: '2022-01-16T00:00:00Z', value: 0},
  92. {name: '2022-01-17T00:00:00Z', value: 0},
  93. {name: '2022-01-18T00:00:00Z', value: 0},
  94. {name: '2022-01-19T00:00:00Z', value: 0},
  95. {name: '2022-01-20T00:00:00Z', value: 37},
  96. {name: '2022-01-21T00:00:00Z', value: 0},
  97. {name: '2022-01-22T00:00:00Z', value: 0},
  98. {name: '2022-01-23T00:00:00Z', value: 0},
  99. {name: '2022-01-24T00:00:00Z', value: 335},
  100. {name: '2022-01-25T00:00:00Z', value: 79},
  101. {name: '2022-01-26T00:00:00Z', value: 0},
  102. {name: '2022-01-27T00:00:00Z', value: 0},
  103. {name: '2022-01-28T00:00:00Z', value: 0},
  104. ],
  105. },
  106. {
  107. seriesName: 'errored, 1 : count_unique(user)',
  108. data: [
  109. {name: '2022-01-15T00:00:00Z', value: 0},
  110. {name: '2022-01-16T00:00:00Z', value: 0},
  111. {name: '2022-01-17T00:00:00Z', value: 0},
  112. {name: '2022-01-18T00:00:00Z', value: 0},
  113. {name: '2022-01-19T00:00:00Z', value: 0},
  114. {name: '2022-01-20T00:00:00Z', value: 1},
  115. {name: '2022-01-21T00:00:00Z', value: 0},
  116. {name: '2022-01-22T00:00:00Z', value: 0},
  117. {name: '2022-01-23T00:00:00Z', value: 0},
  118. {name: '2022-01-24T00:00:00Z', value: 2},
  119. {name: '2022-01-25T00:00:00Z', value: 2},
  120. {name: '2022-01-26T00:00:00Z', value: 0},
  121. {name: '2022-01-27T00:00:00Z', value: 0},
  122. {name: '2022-01-28T00:00:00Z', value: 0},
  123. ],
  124. },
  125. {
  126. seriesName: 'healthy, 1 : sum(session)',
  127. data: [
  128. {name: '2022-01-15T00:00:00Z', value: 0},
  129. {name: '2022-01-16T00:00:00Z', value: 0},
  130. {name: '2022-01-17T00:00:00Z', value: 0},
  131. {name: '2022-01-18T00:00:00Z', value: 0},
  132. {name: '2022-01-19T00:00:00Z', value: 0},
  133. {name: '2022-01-20T00:00:00Z', value: 2503},
  134. {name: '2022-01-21T00:00:00Z', value: 661},
  135. {name: '2022-01-22T00:00:00Z', value: 0},
  136. {name: '2022-01-23T00:00:00Z', value: 0},
  137. {name: '2022-01-24T00:00:00Z', value: 1464},
  138. {name: '2022-01-25T00:00:00Z', value: 430},
  139. {name: '2022-01-26T00:00:00Z', value: 0},
  140. {name: '2022-01-27T00:00:00Z', value: 0},
  141. {name: '2022-01-28T00:00:00Z', value: 0},
  142. ],
  143. },
  144. {
  145. seriesName: 'healthy, 1 : count_unique(user)',
  146. data: [
  147. {name: '2022-01-15T00:00:00Z', value: 0},
  148. {name: '2022-01-16T00:00:00Z', value: 0},
  149. {name: '2022-01-17T00:00:00Z', value: 0},
  150. {name: '2022-01-18T00:00:00Z', value: 0},
  151. {name: '2022-01-19T00:00:00Z', value: 0},
  152. {name: '2022-01-20T00:00:00Z', value: 3},
  153. {name: '2022-01-21T00:00:00Z', value: 3},
  154. {name: '2022-01-22T00:00:00Z', value: 0},
  155. {name: '2022-01-23T00:00:00Z', value: 0},
  156. {name: '2022-01-24T00:00:00Z', value: 1},
  157. {name: '2022-01-25T00:00:00Z', value: 1},
  158. {name: '2022-01-26T00:00:00Z', value: 0},
  159. {name: '2022-01-27T00:00:00Z', value: 0},
  160. {name: '2022-01-28T00:00:00Z', value: 0},
  161. ],
  162. },
  163. {
  164. seriesName: 'crashed, 2 : sum(session)',
  165. data: [
  166. {name: '2022-01-15T00:00:00Z', value: 1},
  167. {name: '2022-01-16T00:00:00Z', value: 0},
  168. {name: '2022-01-17T00:00:00Z', value: 0},
  169. {name: '2022-01-18T00:00:00Z', value: 0},
  170. {name: '2022-01-19T00:00:00Z', value: 0},
  171. {name: '2022-01-20T00:00:00Z', value: 0},
  172. {name: '2022-01-21T00:00:00Z', value: 0},
  173. {name: '2022-01-22T00:00:00Z', value: 0},
  174. {name: '2022-01-23T00:00:00Z', value: 0},
  175. {name: '2022-01-24T00:00:00Z', value: 23},
  176. {name: '2022-01-25T00:00:00Z', value: 11},
  177. {name: '2022-01-26T00:00:00Z', value: 0},
  178. {name: '2022-01-27T00:00:00Z', value: 0},
  179. {name: '2022-01-28T00:00:00Z', value: 0},
  180. ],
  181. },
  182. {
  183. seriesName: 'crashed, 2 : count_unique(user)',
  184. data: [
  185. {name: '2022-01-15T00:00:00Z', value: 1},
  186. {name: '2022-01-16T00:00:00Z', value: 0},
  187. {name: '2022-01-17T00:00:00Z', value: 0},
  188. {name: '2022-01-18T00:00:00Z', value: 0},
  189. {name: '2022-01-19T00:00:00Z', value: 0},
  190. {name: '2022-01-20T00:00:00Z', value: 0},
  191. {name: '2022-01-21T00:00:00Z', value: 0},
  192. {name: '2022-01-22T00:00:00Z', value: 0},
  193. {name: '2022-01-23T00:00:00Z', value: 0},
  194. {name: '2022-01-24T00:00:00Z', value: 2},
  195. {name: '2022-01-25T00:00:00Z', value: 2},
  196. {name: '2022-01-26T00:00:00Z', value: 0},
  197. {name: '2022-01-27T00:00:00Z', value: 0},
  198. {name: '2022-01-28T00:00:00Z', value: 0},
  199. ],
  200. },
  201. {
  202. seriesName: 'abnormal, 2 : sum(session)',
  203. data: [
  204. {name: '2022-01-15T00:00:00Z', value: 1},
  205. {name: '2022-01-16T00:00:00Z', value: 0},
  206. {name: '2022-01-17T00:00:00Z', value: 0},
  207. {name: '2022-01-18T00:00:00Z', value: 0},
  208. {name: '2022-01-19T00:00:00Z', value: 0},
  209. {name: '2022-01-20T00:00:00Z', value: 0},
  210. {name: '2022-01-21T00:00:00Z', value: 0},
  211. {name: '2022-01-22T00:00:00Z', value: 0},
  212. {name: '2022-01-23T00:00:00Z', value: 0},
  213. {name: '2022-01-24T00:00:00Z', value: 0},
  214. {name: '2022-01-25T00:00:00Z', value: 0},
  215. {name: '2022-01-26T00:00:00Z', value: 0},
  216. {name: '2022-01-27T00:00:00Z', value: 0},
  217. {name: '2022-01-28T00:00:00Z', value: 0},
  218. ],
  219. },
  220. {
  221. seriesName: 'abnormal, 2 : count_unique(user)',
  222. data: [
  223. {name: '2022-01-15T00:00:00Z', value: 1},
  224. {name: '2022-01-16T00:00:00Z', value: 0},
  225. {name: '2022-01-17T00:00:00Z', value: 0},
  226. {name: '2022-01-18T00:00:00Z', value: 0},
  227. {name: '2022-01-19T00:00:00Z', value: 0},
  228. {name: '2022-01-20T00:00:00Z', value: 0},
  229. {name: '2022-01-21T00:00:00Z', value: 0},
  230. {name: '2022-01-22T00:00:00Z', value: 0},
  231. {name: '2022-01-23T00:00:00Z', value: 0},
  232. {name: '2022-01-24T00:00:00Z', value: 0},
  233. {name: '2022-01-25T00:00:00Z', value: 0},
  234. {name: '2022-01-26T00:00:00Z', value: 0},
  235. {name: '2022-01-27T00:00:00Z', value: 0},
  236. {name: '2022-01-28T00:00:00Z', value: 0},
  237. ],
  238. },
  239. {
  240. seriesName: 'errored, 2 : sum(session)',
  241. data: [
  242. {name: '2022-01-15T00:00:00Z', value: 1},
  243. {name: '2022-01-16T00:00:00Z', value: 0},
  244. {name: '2022-01-17T00:00:00Z', value: 0},
  245. {name: '2022-01-18T00:00:00Z', value: 0},
  246. {name: '2022-01-19T00:00:00Z', value: 0},
  247. {name: '2022-01-20T00:00:00Z', value: 37},
  248. {name: '2022-01-21T00:00:00Z', value: 0},
  249. {name: '2022-01-22T00:00:00Z', value: 0},
  250. {name: '2022-01-23T00:00:00Z', value: 0},
  251. {name: '2022-01-24T00:00:00Z', value: 335},
  252. {name: '2022-01-25T00:00:00Z', value: 79},
  253. {name: '2022-01-26T00:00:00Z', value: 0},
  254. {name: '2022-01-27T00:00:00Z', value: 0},
  255. {name: '2022-01-28T00:00:00Z', value: 0},
  256. ],
  257. },
  258. {
  259. seriesName: 'errored, 2 : count_unique(user)',
  260. data: [
  261. {name: '2022-01-15T00:00:00Z', value: 1},
  262. {name: '2022-01-16T00:00:00Z', value: 0},
  263. {name: '2022-01-17T00:00:00Z', value: 0},
  264. {name: '2022-01-18T00:00:00Z', value: 0},
  265. {name: '2022-01-19T00:00:00Z', value: 0},
  266. {name: '2022-01-20T00:00:00Z', value: 1},
  267. {name: '2022-01-21T00:00:00Z', value: 0},
  268. {name: '2022-01-22T00:00:00Z', value: 0},
  269. {name: '2022-01-23T00:00:00Z', value: 0},
  270. {name: '2022-01-24T00:00:00Z', value: 1},
  271. {name: '2022-01-25T00:00:00Z', value: 1},
  272. {name: '2022-01-26T00:00:00Z', value: 0},
  273. {name: '2022-01-27T00:00:00Z', value: 0},
  274. {name: '2022-01-28T00:00:00Z', value: 0},
  275. ],
  276. },
  277. {
  278. seriesName: 'healthy, 2 : sum(session)',
  279. data: [
  280. {name: '2022-01-15T00:00:00Z', value: 1},
  281. {name: '2022-01-16T00:00:00Z', value: 0},
  282. {name: '2022-01-17T00:00:00Z', value: 0},
  283. {name: '2022-01-18T00:00:00Z', value: 0},
  284. {name: '2022-01-19T00:00:00Z', value: 0},
  285. {name: '2022-01-20T00:00:00Z', value: 2503},
  286. {name: '2022-01-21T00:00:00Z', value: 661},
  287. {name: '2022-01-22T00:00:00Z', value: 0},
  288. {name: '2022-01-23T00:00:00Z', value: 0},
  289. {name: '2022-01-24T00:00:00Z', value: 1464},
  290. {name: '2022-01-25T00:00:00Z', value: 430},
  291. {name: '2022-01-26T00:00:00Z', value: 0},
  292. {name: '2022-01-27T00:00:00Z', value: 0},
  293. {name: '2022-01-28T00:00:00Z', value: 0},
  294. ],
  295. },
  296. {
  297. seriesName: 'healthy, 2 : count_unique(user)',
  298. data: [
  299. {name: '2022-01-15T00:00:00Z', value: 1},
  300. {name: '2022-01-16T00:00:00Z', value: 0},
  301. {name: '2022-01-17T00:00:00Z', value: 0},
  302. {name: '2022-01-18T00:00:00Z', value: 0},
  303. {name: '2022-01-19T00:00:00Z', value: 0},
  304. {name: '2022-01-20T00:00:00Z', value: 10},
  305. {name: '2022-01-21T00:00:00Z', value: 3},
  306. {name: '2022-01-22T00:00:00Z', value: 0},
  307. {name: '2022-01-23T00:00:00Z', value: 0},
  308. {name: '2022-01-24T00:00:00Z', value: 4},
  309. {name: '2022-01-25T00:00:00Z', value: 3},
  310. {name: '2022-01-26T00:00:00Z', value: 0},
  311. {name: '2022-01-27T00:00:00Z', value: 0},
  312. {name: '2022-01-28T00:00:00Z', value: 0},
  313. ],
  314. },
  315. ]);
  316. });
  317. it('adds derived status series', () => {
  318. expect(
  319. transformSessionsResponseToSeries(
  320. SessionUserCountByStatusByRelease(),
  321. ['count_crashed(session)'],
  322. []
  323. )
  324. ).toEqual([
  325. {
  326. seriesName: 'crashed, 1 : sum(session)',
  327. data: [
  328. {name: '2022-01-15T00:00:00Z', value: 0},
  329. {name: '2022-01-16T00:00:00Z', value: 0},
  330. {name: '2022-01-17T00:00:00Z', value: 0},
  331. {name: '2022-01-18T00:00:00Z', value: 0},
  332. {name: '2022-01-19T00:00:00Z', value: 0},
  333. {name: '2022-01-20T00:00:00Z', value: 0},
  334. {name: '2022-01-21T00:00:00Z', value: 0},
  335. {name: '2022-01-22T00:00:00Z', value: 0},
  336. {name: '2022-01-23T00:00:00Z', value: 0},
  337. {name: '2022-01-24T00:00:00Z', value: 23},
  338. {name: '2022-01-25T00:00:00Z', value: 11},
  339. {name: '2022-01-26T00:00:00Z', value: 0},
  340. {name: '2022-01-27T00:00:00Z', value: 0},
  341. {name: '2022-01-28T00:00:00Z', value: 0},
  342. ],
  343. },
  344. {
  345. seriesName: 'crashed, 1 : count_unique(user)',
  346. data: [
  347. {name: '2022-01-15T00:00:00Z', value: 0},
  348. {name: '2022-01-16T00:00:00Z', value: 0},
  349. {name: '2022-01-17T00:00:00Z', value: 0},
  350. {name: '2022-01-18T00:00:00Z', value: 0},
  351. {name: '2022-01-19T00:00:00Z', value: 0},
  352. {name: '2022-01-20T00:00:00Z', value: 0},
  353. {name: '2022-01-21T00:00:00Z', value: 0},
  354. {name: '2022-01-22T00:00:00Z', value: 0},
  355. {name: '2022-01-23T00:00:00Z', value: 0},
  356. {name: '2022-01-24T00:00:00Z', value: 1},
  357. {name: '2022-01-25T00:00:00Z', value: 1},
  358. {name: '2022-01-26T00:00:00Z', value: 0},
  359. {name: '2022-01-27T00:00:00Z', value: 0},
  360. {name: '2022-01-28T00:00:00Z', value: 0},
  361. ],
  362. },
  363. {
  364. seriesName: 'crashed, 1 : count_crashed(session)',
  365. data: [
  366. {name: '2022-01-15T00:00:00Z', value: 0},
  367. {name: '2022-01-16T00:00:00Z', value: 0},
  368. {name: '2022-01-17T00:00:00Z', value: 0},
  369. {name: '2022-01-18T00:00:00Z', value: 0},
  370. {name: '2022-01-19T00:00:00Z', value: 0},
  371. {name: '2022-01-20T00:00:00Z', value: 0},
  372. {name: '2022-01-21T00:00:00Z', value: 0},
  373. {name: '2022-01-22T00:00:00Z', value: 0},
  374. {name: '2022-01-23T00:00:00Z', value: 0},
  375. {name: '2022-01-24T00:00:00Z', value: 23},
  376. {name: '2022-01-25T00:00:00Z', value: 11},
  377. {name: '2022-01-26T00:00:00Z', value: 0},
  378. {name: '2022-01-27T00:00:00Z', value: 0},
  379. {name: '2022-01-28T00:00:00Z', value: 0},
  380. ],
  381. },
  382. {
  383. seriesName: 'abnormal, 1 : sum(session)',
  384. data: [
  385. {name: '2022-01-15T00:00:00Z', value: 1},
  386. {name: '2022-01-16T00:00:00Z', value: 0},
  387. {name: '2022-01-17T00:00:00Z', value: 0},
  388. {name: '2022-01-18T00:00:00Z', value: 0},
  389. {name: '2022-01-19T00:00:00Z', value: 0},
  390. {name: '2022-01-20T00:00:00Z', value: 0},
  391. {name: '2022-01-21T00:00:00Z', value: 0},
  392. {name: '2022-01-22T00:00:00Z', value: 0},
  393. {name: '2022-01-23T00:00:00Z', value: 0},
  394. {name: '2022-01-24T00:00:00Z', value: 0},
  395. {name: '2022-01-25T00:00:00Z', value: 0},
  396. {name: '2022-01-26T00:00:00Z', value: 0},
  397. {name: '2022-01-27T00:00:00Z', value: 0},
  398. {name: '2022-01-28T00:00:00Z', value: 0},
  399. ],
  400. },
  401. {
  402. seriesName: 'abnormal, 1 : count_unique(user)',
  403. data: [
  404. {name: '2022-01-15T00:00:00Z', value: 1},
  405. {name: '2022-01-16T00:00:00Z', value: 0},
  406. {name: '2022-01-17T00:00:00Z', value: 0},
  407. {name: '2022-01-18T00:00:00Z', value: 0},
  408. {name: '2022-01-19T00:00:00Z', value: 0},
  409. {name: '2022-01-20T00:00:00Z', value: 0},
  410. {name: '2022-01-21T00:00:00Z', value: 0},
  411. {name: '2022-01-22T00:00:00Z', value: 0},
  412. {name: '2022-01-23T00:00:00Z', value: 0},
  413. {name: '2022-01-24T00:00:00Z', value: 0},
  414. {name: '2022-01-25T00:00:00Z', value: 0},
  415. {name: '2022-01-26T00:00:00Z', value: 0},
  416. {name: '2022-01-27T00:00:00Z', value: 0},
  417. {name: '2022-01-28T00:00:00Z', value: 0},
  418. ],
  419. },
  420. {
  421. seriesName: 'abnormal, 1 : count_crashed(session)',
  422. data: [
  423. {name: '2022-01-15T00:00:00Z', value: 0},
  424. {name: '2022-01-16T00:00:00Z', value: 0},
  425. {name: '2022-01-17T00:00:00Z', value: 0},
  426. {name: '2022-01-18T00:00:00Z', value: 0},
  427. {name: '2022-01-19T00:00:00Z', value: 0},
  428. {name: '2022-01-20T00:00:00Z', value: 0},
  429. {name: '2022-01-21T00:00:00Z', value: 0},
  430. {name: '2022-01-22T00:00:00Z', value: 0},
  431. {name: '2022-01-23T00:00:00Z', value: 0},
  432. {name: '2022-01-24T00:00:00Z', value: 0},
  433. {name: '2022-01-25T00:00:00Z', value: 0},
  434. {name: '2022-01-26T00:00:00Z', value: 0},
  435. {name: '2022-01-27T00:00:00Z', value: 0},
  436. {name: '2022-01-28T00:00:00Z', value: 0},
  437. ],
  438. },
  439. {
  440. seriesName: 'errored, 1 : sum(session)',
  441. data: [
  442. {name: '2022-01-15T00:00:00Z', value: 0},
  443. {name: '2022-01-16T00:00:00Z', value: 0},
  444. {name: '2022-01-17T00:00:00Z', value: 0},
  445. {name: '2022-01-18T00:00:00Z', value: 0},
  446. {name: '2022-01-19T00:00:00Z', value: 0},
  447. {name: '2022-01-20T00:00:00Z', value: 37},
  448. {name: '2022-01-21T00:00:00Z', value: 0},
  449. {name: '2022-01-22T00:00:00Z', value: 0},
  450. {name: '2022-01-23T00:00:00Z', value: 0},
  451. {name: '2022-01-24T00:00:00Z', value: 335},
  452. {name: '2022-01-25T00:00:00Z', value: 79},
  453. {name: '2022-01-26T00:00:00Z', value: 0},
  454. {name: '2022-01-27T00:00:00Z', value: 0},
  455. {name: '2022-01-28T00:00:00Z', value: 0},
  456. ],
  457. },
  458. {
  459. seriesName: 'errored, 1 : count_unique(user)',
  460. data: [
  461. {name: '2022-01-15T00:00:00Z', value: 0},
  462. {name: '2022-01-16T00:00:00Z', value: 0},
  463. {name: '2022-01-17T00:00:00Z', value: 0},
  464. {name: '2022-01-18T00:00:00Z', value: 0},
  465. {name: '2022-01-19T00:00:00Z', value: 0},
  466. {name: '2022-01-20T00:00:00Z', value: 1},
  467. {name: '2022-01-21T00:00:00Z', value: 0},
  468. {name: '2022-01-22T00:00:00Z', value: 0},
  469. {name: '2022-01-23T00:00:00Z', value: 0},
  470. {name: '2022-01-24T00:00:00Z', value: 2},
  471. {name: '2022-01-25T00:00:00Z', value: 2},
  472. {name: '2022-01-26T00:00:00Z', value: 0},
  473. {name: '2022-01-27T00:00:00Z', value: 0},
  474. {name: '2022-01-28T00:00:00Z', value: 0},
  475. ],
  476. },
  477. {
  478. seriesName: 'errored, 1 : count_crashed(session)',
  479. data: [
  480. {name: '2022-01-15T00:00:00Z', value: 0},
  481. {name: '2022-01-16T00:00:00Z', value: 0},
  482. {name: '2022-01-17T00:00:00Z', value: 0},
  483. {name: '2022-01-18T00:00:00Z', value: 0},
  484. {name: '2022-01-19T00:00:00Z', value: 0},
  485. {name: '2022-01-20T00:00:00Z', value: 0},
  486. {name: '2022-01-21T00:00:00Z', value: 0},
  487. {name: '2022-01-22T00:00:00Z', value: 0},
  488. {name: '2022-01-23T00:00:00Z', value: 0},
  489. {name: '2022-01-24T00:00:00Z', value: 0},
  490. {name: '2022-01-25T00:00:00Z', value: 0},
  491. {name: '2022-01-26T00:00:00Z', value: 0},
  492. {name: '2022-01-27T00:00:00Z', value: 0},
  493. {name: '2022-01-28T00:00:00Z', value: 0},
  494. ],
  495. },
  496. {
  497. seriesName: 'healthy, 1 : sum(session)',
  498. data: [
  499. {name: '2022-01-15T00:00:00Z', value: 0},
  500. {name: '2022-01-16T00:00:00Z', value: 0},
  501. {name: '2022-01-17T00:00:00Z', value: 0},
  502. {name: '2022-01-18T00:00:00Z', value: 0},
  503. {name: '2022-01-19T00:00:00Z', value: 0},
  504. {name: '2022-01-20T00:00:00Z', value: 2503},
  505. {name: '2022-01-21T00:00:00Z', value: 661},
  506. {name: '2022-01-22T00:00:00Z', value: 0},
  507. {name: '2022-01-23T00:00:00Z', value: 0},
  508. {name: '2022-01-24T00:00:00Z', value: 1464},
  509. {name: '2022-01-25T00:00:00Z', value: 430},
  510. {name: '2022-01-26T00:00:00Z', value: 0},
  511. {name: '2022-01-27T00:00:00Z', value: 0},
  512. {name: '2022-01-28T00:00:00Z', value: 0},
  513. ],
  514. },
  515. {
  516. seriesName: 'healthy, 1 : count_unique(user)',
  517. data: [
  518. {name: '2022-01-15T00:00:00Z', value: 0},
  519. {name: '2022-01-16T00:00:00Z', value: 0},
  520. {name: '2022-01-17T00:00:00Z', value: 0},
  521. {name: '2022-01-18T00:00:00Z', value: 0},
  522. {name: '2022-01-19T00:00:00Z', value: 0},
  523. {name: '2022-01-20T00:00:00Z', value: 3},
  524. {name: '2022-01-21T00:00:00Z', value: 3},
  525. {name: '2022-01-22T00:00:00Z', value: 0},
  526. {name: '2022-01-23T00:00:00Z', value: 0},
  527. {name: '2022-01-24T00:00:00Z', value: 1},
  528. {name: '2022-01-25T00:00:00Z', value: 1},
  529. {name: '2022-01-26T00:00:00Z', value: 0},
  530. {name: '2022-01-27T00:00:00Z', value: 0},
  531. {name: '2022-01-28T00:00:00Z', value: 0},
  532. ],
  533. },
  534. {
  535. seriesName: 'healthy, 1 : count_crashed(session)',
  536. data: [
  537. {name: '2022-01-15T00:00:00Z', value: 0},
  538. {name: '2022-01-16T00:00:00Z', value: 0},
  539. {name: '2022-01-17T00:00:00Z', value: 0},
  540. {name: '2022-01-18T00:00:00Z', value: 0},
  541. {name: '2022-01-19T00:00:00Z', value: 0},
  542. {name: '2022-01-20T00:00:00Z', value: 0},
  543. {name: '2022-01-21T00:00:00Z', value: 0},
  544. {name: '2022-01-22T00:00:00Z', value: 0},
  545. {name: '2022-01-23T00:00:00Z', value: 0},
  546. {name: '2022-01-24T00:00:00Z', value: 0},
  547. {name: '2022-01-25T00:00:00Z', value: 0},
  548. {name: '2022-01-26T00:00:00Z', value: 0},
  549. {name: '2022-01-27T00:00:00Z', value: 0},
  550. {name: '2022-01-28T00:00:00Z', value: 0},
  551. ],
  552. },
  553. {
  554. seriesName: 'crashed, 2 : sum(session)',
  555. data: [
  556. {name: '2022-01-15T00:00:00Z', value: 1},
  557. {name: '2022-01-16T00:00:00Z', value: 0},
  558. {name: '2022-01-17T00:00:00Z', value: 0},
  559. {name: '2022-01-18T00:00:00Z', value: 0},
  560. {name: '2022-01-19T00:00:00Z', value: 0},
  561. {name: '2022-01-20T00:00:00Z', value: 0},
  562. {name: '2022-01-21T00:00:00Z', value: 0},
  563. {name: '2022-01-22T00:00:00Z', value: 0},
  564. {name: '2022-01-23T00:00:00Z', value: 0},
  565. {name: '2022-01-24T00:00:00Z', value: 23},
  566. {name: '2022-01-25T00:00:00Z', value: 11},
  567. {name: '2022-01-26T00:00:00Z', value: 0},
  568. {name: '2022-01-27T00:00:00Z', value: 0},
  569. {name: '2022-01-28T00:00:00Z', value: 0},
  570. ],
  571. },
  572. {
  573. seriesName: 'crashed, 2 : count_unique(user)',
  574. data: [
  575. {name: '2022-01-15T00:00:00Z', value: 1},
  576. {name: '2022-01-16T00:00:00Z', value: 0},
  577. {name: '2022-01-17T00:00:00Z', value: 0},
  578. {name: '2022-01-18T00:00:00Z', value: 0},
  579. {name: '2022-01-19T00:00:00Z', value: 0},
  580. {name: '2022-01-20T00:00:00Z', value: 0},
  581. {name: '2022-01-21T00:00:00Z', value: 0},
  582. {name: '2022-01-22T00:00:00Z', value: 0},
  583. {name: '2022-01-23T00:00:00Z', value: 0},
  584. {name: '2022-01-24T00:00:00Z', value: 2},
  585. {name: '2022-01-25T00:00:00Z', value: 2},
  586. {name: '2022-01-26T00:00:00Z', value: 0},
  587. {name: '2022-01-27T00:00:00Z', value: 0},
  588. {name: '2022-01-28T00:00:00Z', value: 0},
  589. ],
  590. },
  591. {
  592. seriesName: 'crashed, 2 : count_crashed(session)',
  593. data: [
  594. {name: '2022-01-15T00:00:00Z', value: 1},
  595. {name: '2022-01-16T00:00:00Z', value: 0},
  596. {name: '2022-01-17T00:00:00Z', value: 0},
  597. {name: '2022-01-18T00:00:00Z', value: 0},
  598. {name: '2022-01-19T00:00:00Z', value: 0},
  599. {name: '2022-01-20T00:00:00Z', value: 0},
  600. {name: '2022-01-21T00:00:00Z', value: 0},
  601. {name: '2022-01-22T00:00:00Z', value: 0},
  602. {name: '2022-01-23T00:00:00Z', value: 0},
  603. {name: '2022-01-24T00:00:00Z', value: 23},
  604. {name: '2022-01-25T00:00:00Z', value: 11},
  605. {name: '2022-01-26T00:00:00Z', value: 0},
  606. {name: '2022-01-27T00:00:00Z', value: 0},
  607. {name: '2022-01-28T00:00:00Z', value: 0},
  608. ],
  609. },
  610. {
  611. seriesName: 'abnormal, 2 : sum(session)',
  612. data: [
  613. {name: '2022-01-15T00:00:00Z', value: 1},
  614. {name: '2022-01-16T00:00:00Z', value: 0},
  615. {name: '2022-01-17T00:00:00Z', value: 0},
  616. {name: '2022-01-18T00:00:00Z', value: 0},
  617. {name: '2022-01-19T00:00:00Z', value: 0},
  618. {name: '2022-01-20T00:00:00Z', value: 0},
  619. {name: '2022-01-21T00:00:00Z', value: 0},
  620. {name: '2022-01-22T00:00:00Z', value: 0},
  621. {name: '2022-01-23T00:00:00Z', value: 0},
  622. {name: '2022-01-24T00:00:00Z', value: 0},
  623. {name: '2022-01-25T00:00:00Z', value: 0},
  624. {name: '2022-01-26T00:00:00Z', value: 0},
  625. {name: '2022-01-27T00:00:00Z', value: 0},
  626. {name: '2022-01-28T00:00:00Z', value: 0},
  627. ],
  628. },
  629. {
  630. seriesName: 'abnormal, 2 : count_unique(user)',
  631. data: [
  632. {name: '2022-01-15T00:00:00Z', value: 1},
  633. {name: '2022-01-16T00:00:00Z', value: 0},
  634. {name: '2022-01-17T00:00:00Z', value: 0},
  635. {name: '2022-01-18T00:00:00Z', value: 0},
  636. {name: '2022-01-19T00:00:00Z', value: 0},
  637. {name: '2022-01-20T00:00:00Z', value: 0},
  638. {name: '2022-01-21T00:00:00Z', value: 0},
  639. {name: '2022-01-22T00:00:00Z', value: 0},
  640. {name: '2022-01-23T00:00:00Z', value: 0},
  641. {name: '2022-01-24T00:00:00Z', value: 0},
  642. {name: '2022-01-25T00:00:00Z', value: 0},
  643. {name: '2022-01-26T00:00:00Z', value: 0},
  644. {name: '2022-01-27T00:00:00Z', value: 0},
  645. {name: '2022-01-28T00:00:00Z', value: 0},
  646. ],
  647. },
  648. {
  649. seriesName: 'abnormal, 2 : count_crashed(session)',
  650. data: [
  651. {name: '2022-01-15T00:00:00Z', value: 0},
  652. {name: '2022-01-16T00:00:00Z', value: 0},
  653. {name: '2022-01-17T00:00:00Z', value: 0},
  654. {name: '2022-01-18T00:00:00Z', value: 0},
  655. {name: '2022-01-19T00:00:00Z', value: 0},
  656. {name: '2022-01-20T00:00:00Z', value: 0},
  657. {name: '2022-01-21T00:00:00Z', value: 0},
  658. {name: '2022-01-22T00:00:00Z', value: 0},
  659. {name: '2022-01-23T00:00:00Z', value: 0},
  660. {name: '2022-01-24T00:00:00Z', value: 0},
  661. {name: '2022-01-25T00:00:00Z', value: 0},
  662. {name: '2022-01-26T00:00:00Z', value: 0},
  663. {name: '2022-01-27T00:00:00Z', value: 0},
  664. {name: '2022-01-28T00:00:00Z', value: 0},
  665. ],
  666. },
  667. {
  668. seriesName: 'errored, 2 : sum(session)',
  669. data: [
  670. {name: '2022-01-15T00:00:00Z', value: 1},
  671. {name: '2022-01-16T00:00:00Z', value: 0},
  672. {name: '2022-01-17T00:00:00Z', value: 0},
  673. {name: '2022-01-18T00:00:00Z', value: 0},
  674. {name: '2022-01-19T00:00:00Z', value: 0},
  675. {name: '2022-01-20T00:00:00Z', value: 37},
  676. {name: '2022-01-21T00:00:00Z', value: 0},
  677. {name: '2022-01-22T00:00:00Z', value: 0},
  678. {name: '2022-01-23T00:00:00Z', value: 0},
  679. {name: '2022-01-24T00:00:00Z', value: 335},
  680. {name: '2022-01-25T00:00:00Z', value: 79},
  681. {name: '2022-01-26T00:00:00Z', value: 0},
  682. {name: '2022-01-27T00:00:00Z', value: 0},
  683. {name: '2022-01-28T00:00:00Z', value: 0},
  684. ],
  685. },
  686. {
  687. seriesName: 'errored, 2 : count_unique(user)',
  688. data: [
  689. {name: '2022-01-15T00:00:00Z', value: 1},
  690. {name: '2022-01-16T00:00:00Z', value: 0},
  691. {name: '2022-01-17T00:00:00Z', value: 0},
  692. {name: '2022-01-18T00:00:00Z', value: 0},
  693. {name: '2022-01-19T00:00:00Z', value: 0},
  694. {name: '2022-01-20T00:00:00Z', value: 1},
  695. {name: '2022-01-21T00:00:00Z', value: 0},
  696. {name: '2022-01-22T00:00:00Z', value: 0},
  697. {name: '2022-01-23T00:00:00Z', value: 0},
  698. {name: '2022-01-24T00:00:00Z', value: 1},
  699. {name: '2022-01-25T00:00:00Z', value: 1},
  700. {name: '2022-01-26T00:00:00Z', value: 0},
  701. {name: '2022-01-27T00:00:00Z', value: 0},
  702. {name: '2022-01-28T00:00:00Z', value: 0},
  703. ],
  704. },
  705. {
  706. seriesName: 'errored, 2 : count_crashed(session)',
  707. data: [
  708. {name: '2022-01-15T00:00:00Z', value: 0},
  709. {name: '2022-01-16T00:00:00Z', value: 0},
  710. {name: '2022-01-17T00:00:00Z', value: 0},
  711. {name: '2022-01-18T00:00:00Z', value: 0},
  712. {name: '2022-01-19T00:00:00Z', value: 0},
  713. {name: '2022-01-20T00:00:00Z', value: 0},
  714. {name: '2022-01-21T00:00:00Z', value: 0},
  715. {name: '2022-01-22T00:00:00Z', value: 0},
  716. {name: '2022-01-23T00:00:00Z', value: 0},
  717. {name: '2022-01-24T00:00:00Z', value: 0},
  718. {name: '2022-01-25T00:00:00Z', value: 0},
  719. {name: '2022-01-26T00:00:00Z', value: 0},
  720. {name: '2022-01-27T00:00:00Z', value: 0},
  721. {name: '2022-01-28T00:00:00Z', value: 0},
  722. ],
  723. },
  724. {
  725. seriesName: 'healthy, 2 : sum(session)',
  726. data: [
  727. {name: '2022-01-15T00:00:00Z', value: 1},
  728. {name: '2022-01-16T00:00:00Z', value: 0},
  729. {name: '2022-01-17T00:00:00Z', value: 0},
  730. {name: '2022-01-18T00:00:00Z', value: 0},
  731. {name: '2022-01-19T00:00:00Z', value: 0},
  732. {name: '2022-01-20T00:00:00Z', value: 2503},
  733. {name: '2022-01-21T00:00:00Z', value: 661},
  734. {name: '2022-01-22T00:00:00Z', value: 0},
  735. {name: '2022-01-23T00:00:00Z', value: 0},
  736. {name: '2022-01-24T00:00:00Z', value: 1464},
  737. {name: '2022-01-25T00:00:00Z', value: 430},
  738. {name: '2022-01-26T00:00:00Z', value: 0},
  739. {name: '2022-01-27T00:00:00Z', value: 0},
  740. {name: '2022-01-28T00:00:00Z', value: 0},
  741. ],
  742. },
  743. {
  744. seriesName: 'healthy, 2 : count_unique(user)',
  745. data: [
  746. {name: '2022-01-15T00:00:00Z', value: 1},
  747. {name: '2022-01-16T00:00:00Z', value: 0},
  748. {name: '2022-01-17T00:00:00Z', value: 0},
  749. {name: '2022-01-18T00:00:00Z', value: 0},
  750. {name: '2022-01-19T00:00:00Z', value: 0},
  751. {name: '2022-01-20T00:00:00Z', value: 10},
  752. {name: '2022-01-21T00:00:00Z', value: 3},
  753. {name: '2022-01-22T00:00:00Z', value: 0},
  754. {name: '2022-01-23T00:00:00Z', value: 0},
  755. {name: '2022-01-24T00:00:00Z', value: 4},
  756. {name: '2022-01-25T00:00:00Z', value: 3},
  757. {name: '2022-01-26T00:00:00Z', value: 0},
  758. {name: '2022-01-27T00:00:00Z', value: 0},
  759. {name: '2022-01-28T00:00:00Z', value: 0},
  760. ],
  761. },
  762. {
  763. seriesName: 'healthy, 2 : count_crashed(session)',
  764. data: [
  765. {name: '2022-01-15T00:00:00Z', value: 0},
  766. {name: '2022-01-16T00:00:00Z', value: 0},
  767. {name: '2022-01-17T00:00:00Z', value: 0},
  768. {name: '2022-01-18T00:00:00Z', value: 0},
  769. {name: '2022-01-19T00:00:00Z', value: 0},
  770. {name: '2022-01-20T00:00:00Z', value: 0},
  771. {name: '2022-01-21T00:00:00Z', value: 0},
  772. {name: '2022-01-22T00:00:00Z', value: 0},
  773. {name: '2022-01-23T00:00:00Z', value: 0},
  774. {name: '2022-01-24T00:00:00Z', value: 0},
  775. {name: '2022-01-25T00:00:00Z', value: 0},
  776. {name: '2022-01-26T00:00:00Z', value: 0},
  777. {name: '2022-01-27T00:00:00Z', value: 0},
  778. {name: '2022-01-28T00:00:00Z', value: 0},
  779. ],
  780. },
  781. ]);
  782. });
  783. it('omits injected fields', () => {
  784. expect(
  785. transformSessionsResponseToSeries(
  786. SessionUserCountByStatusByRelease(),
  787. ['count_crashed(session)'],
  788. ['sum(session)']
  789. )
  790. ).toEqual([
  791. {
  792. seriesName: 'crashed, 1 : count_unique(user)',
  793. data: [
  794. {name: '2022-01-15T00:00:00Z', value: 0},
  795. {name: '2022-01-16T00:00:00Z', value: 0},
  796. {name: '2022-01-17T00:00:00Z', value: 0},
  797. {name: '2022-01-18T00:00:00Z', value: 0},
  798. {name: '2022-01-19T00:00:00Z', value: 0},
  799. {name: '2022-01-20T00:00:00Z', value: 0},
  800. {name: '2022-01-21T00:00:00Z', value: 0},
  801. {name: '2022-01-22T00:00:00Z', value: 0},
  802. {name: '2022-01-23T00:00:00Z', value: 0},
  803. {name: '2022-01-24T00:00:00Z', value: 1},
  804. {name: '2022-01-25T00:00:00Z', value: 1},
  805. {name: '2022-01-26T00:00:00Z', value: 0},
  806. {name: '2022-01-27T00:00:00Z', value: 0},
  807. {name: '2022-01-28T00:00:00Z', value: 0},
  808. ],
  809. },
  810. {
  811. seriesName: 'crashed, 1 : count_crashed(session)',
  812. data: [
  813. {name: '2022-01-15T00:00:00Z', value: 0},
  814. {name: '2022-01-16T00:00:00Z', value: 0},
  815. {name: '2022-01-17T00:00:00Z', value: 0},
  816. {name: '2022-01-18T00:00:00Z', value: 0},
  817. {name: '2022-01-19T00:00:00Z', value: 0},
  818. {name: '2022-01-20T00:00:00Z', value: 0},
  819. {name: '2022-01-21T00:00:00Z', value: 0},
  820. {name: '2022-01-22T00:00:00Z', value: 0},
  821. {name: '2022-01-23T00:00:00Z', value: 0},
  822. {name: '2022-01-24T00:00:00Z', value: 23},
  823. {name: '2022-01-25T00:00:00Z', value: 11},
  824. {name: '2022-01-26T00:00:00Z', value: 0},
  825. {name: '2022-01-27T00:00:00Z', value: 0},
  826. {name: '2022-01-28T00:00:00Z', value: 0},
  827. ],
  828. },
  829. {
  830. seriesName: 'abnormal, 1 : count_unique(user)',
  831. data: [
  832. {name: '2022-01-15T00:00:00Z', value: 1},
  833. {name: '2022-01-16T00:00:00Z', value: 0},
  834. {name: '2022-01-17T00:00:00Z', value: 0},
  835. {name: '2022-01-18T00:00:00Z', value: 0},
  836. {name: '2022-01-19T00:00:00Z', value: 0},
  837. {name: '2022-01-20T00:00:00Z', value: 0},
  838. {name: '2022-01-21T00:00:00Z', value: 0},
  839. {name: '2022-01-22T00:00:00Z', value: 0},
  840. {name: '2022-01-23T00:00:00Z', value: 0},
  841. {name: '2022-01-24T00:00:00Z', value: 0},
  842. {name: '2022-01-25T00:00:00Z', value: 0},
  843. {name: '2022-01-26T00:00:00Z', value: 0},
  844. {name: '2022-01-27T00:00:00Z', value: 0},
  845. {name: '2022-01-28T00:00:00Z', value: 0},
  846. ],
  847. },
  848. {
  849. seriesName: 'abnormal, 1 : count_crashed(session)',
  850. data: [
  851. {name: '2022-01-15T00:00:00Z', value: 0},
  852. {name: '2022-01-16T00:00:00Z', value: 0},
  853. {name: '2022-01-17T00:00:00Z', value: 0},
  854. {name: '2022-01-18T00:00:00Z', value: 0},
  855. {name: '2022-01-19T00:00:00Z', value: 0},
  856. {name: '2022-01-20T00:00:00Z', value: 0},
  857. {name: '2022-01-21T00:00:00Z', value: 0},
  858. {name: '2022-01-22T00:00:00Z', value: 0},
  859. {name: '2022-01-23T00:00:00Z', value: 0},
  860. {name: '2022-01-24T00:00:00Z', value: 0},
  861. {name: '2022-01-25T00:00:00Z', value: 0},
  862. {name: '2022-01-26T00:00:00Z', value: 0},
  863. {name: '2022-01-27T00:00:00Z', value: 0},
  864. {name: '2022-01-28T00:00:00Z', value: 0},
  865. ],
  866. },
  867. {
  868. seriesName: 'errored, 1 : count_unique(user)',
  869. data: [
  870. {name: '2022-01-15T00:00:00Z', value: 0},
  871. {name: '2022-01-16T00:00:00Z', value: 0},
  872. {name: '2022-01-17T00:00:00Z', value: 0},
  873. {name: '2022-01-18T00:00:00Z', value: 0},
  874. {name: '2022-01-19T00:00:00Z', value: 0},
  875. {name: '2022-01-20T00:00:00Z', value: 1},
  876. {name: '2022-01-21T00:00:00Z', value: 0},
  877. {name: '2022-01-22T00:00:00Z', value: 0},
  878. {name: '2022-01-23T00:00:00Z', value: 0},
  879. {name: '2022-01-24T00:00:00Z', value: 2},
  880. {name: '2022-01-25T00:00:00Z', value: 2},
  881. {name: '2022-01-26T00:00:00Z', value: 0},
  882. {name: '2022-01-27T00:00:00Z', value: 0},
  883. {name: '2022-01-28T00:00:00Z', value: 0},
  884. ],
  885. },
  886. {
  887. seriesName: 'errored, 1 : count_crashed(session)',
  888. data: [
  889. {name: '2022-01-15T00:00:00Z', value: 0},
  890. {name: '2022-01-16T00:00:00Z', value: 0},
  891. {name: '2022-01-17T00:00:00Z', value: 0},
  892. {name: '2022-01-18T00:00:00Z', value: 0},
  893. {name: '2022-01-19T00:00:00Z', value: 0},
  894. {name: '2022-01-20T00:00:00Z', value: 0},
  895. {name: '2022-01-21T00:00:00Z', value: 0},
  896. {name: '2022-01-22T00:00:00Z', value: 0},
  897. {name: '2022-01-23T00:00:00Z', value: 0},
  898. {name: '2022-01-24T00:00:00Z', value: 0},
  899. {name: '2022-01-25T00:00:00Z', value: 0},
  900. {name: '2022-01-26T00:00:00Z', value: 0},
  901. {name: '2022-01-27T00:00:00Z', value: 0},
  902. {name: '2022-01-28T00:00:00Z', value: 0},
  903. ],
  904. },
  905. {
  906. seriesName: 'healthy, 1 : count_unique(user)',
  907. data: [
  908. {name: '2022-01-15T00:00:00Z', value: 0},
  909. {name: '2022-01-16T00:00:00Z', value: 0},
  910. {name: '2022-01-17T00:00:00Z', value: 0},
  911. {name: '2022-01-18T00:00:00Z', value: 0},
  912. {name: '2022-01-19T00:00:00Z', value: 0},
  913. {name: '2022-01-20T00:00:00Z', value: 3},
  914. {name: '2022-01-21T00:00:00Z', value: 3},
  915. {name: '2022-01-22T00:00:00Z', value: 0},
  916. {name: '2022-01-23T00:00:00Z', value: 0},
  917. {name: '2022-01-24T00:00:00Z', value: 1},
  918. {name: '2022-01-25T00:00:00Z', value: 1},
  919. {name: '2022-01-26T00:00:00Z', value: 0},
  920. {name: '2022-01-27T00:00:00Z', value: 0},
  921. {name: '2022-01-28T00:00:00Z', value: 0},
  922. ],
  923. },
  924. {
  925. seriesName: 'healthy, 1 : count_crashed(session)',
  926. data: [
  927. {name: '2022-01-15T00:00:00Z', value: 0},
  928. {name: '2022-01-16T00:00:00Z', value: 0},
  929. {name: '2022-01-17T00:00:00Z', value: 0},
  930. {name: '2022-01-18T00:00:00Z', value: 0},
  931. {name: '2022-01-19T00:00:00Z', value: 0},
  932. {name: '2022-01-20T00:00:00Z', value: 0},
  933. {name: '2022-01-21T00:00:00Z', value: 0},
  934. {name: '2022-01-22T00:00:00Z', value: 0},
  935. {name: '2022-01-23T00:00:00Z', value: 0},
  936. {name: '2022-01-24T00:00:00Z', value: 0},
  937. {name: '2022-01-25T00:00:00Z', value: 0},
  938. {name: '2022-01-26T00:00:00Z', value: 0},
  939. {name: '2022-01-27T00:00:00Z', value: 0},
  940. {name: '2022-01-28T00:00:00Z', value: 0},
  941. ],
  942. },
  943. {
  944. seriesName: 'crashed, 2 : count_unique(user)',
  945. data: [
  946. {name: '2022-01-15T00:00:00Z', value: 1},
  947. {name: '2022-01-16T00:00:00Z', value: 0},
  948. {name: '2022-01-17T00:00:00Z', value: 0},
  949. {name: '2022-01-18T00:00:00Z', value: 0},
  950. {name: '2022-01-19T00:00:00Z', value: 0},
  951. {name: '2022-01-20T00:00:00Z', value: 0},
  952. {name: '2022-01-21T00:00:00Z', value: 0},
  953. {name: '2022-01-22T00:00:00Z', value: 0},
  954. {name: '2022-01-23T00:00:00Z', value: 0},
  955. {name: '2022-01-24T00:00:00Z', value: 2},
  956. {name: '2022-01-25T00:00:00Z', value: 2},
  957. {name: '2022-01-26T00:00:00Z', value: 0},
  958. {name: '2022-01-27T00:00:00Z', value: 0},
  959. {name: '2022-01-28T00:00:00Z', value: 0},
  960. ],
  961. },
  962. {
  963. seriesName: 'crashed, 2 : count_crashed(session)',
  964. data: [
  965. {name: '2022-01-15T00:00:00Z', value: 1},
  966. {name: '2022-01-16T00:00:00Z', value: 0},
  967. {name: '2022-01-17T00:00:00Z', value: 0},
  968. {name: '2022-01-18T00:00:00Z', value: 0},
  969. {name: '2022-01-19T00:00:00Z', value: 0},
  970. {name: '2022-01-20T00:00:00Z', value: 0},
  971. {name: '2022-01-21T00:00:00Z', value: 0},
  972. {name: '2022-01-22T00:00:00Z', value: 0},
  973. {name: '2022-01-23T00:00:00Z', value: 0},
  974. {name: '2022-01-24T00:00:00Z', value: 23},
  975. {name: '2022-01-25T00:00:00Z', value: 11},
  976. {name: '2022-01-26T00:00:00Z', value: 0},
  977. {name: '2022-01-27T00:00:00Z', value: 0},
  978. {name: '2022-01-28T00:00:00Z', value: 0},
  979. ],
  980. },
  981. {
  982. seriesName: 'abnormal, 2 : count_unique(user)',
  983. data: [
  984. {name: '2022-01-15T00:00:00Z', value: 1},
  985. {name: '2022-01-16T00:00:00Z', value: 0},
  986. {name: '2022-01-17T00:00:00Z', value: 0},
  987. {name: '2022-01-18T00:00:00Z', value: 0},
  988. {name: '2022-01-19T00:00:00Z', value: 0},
  989. {name: '2022-01-20T00:00:00Z', value: 0},
  990. {name: '2022-01-21T00:00:00Z', value: 0},
  991. {name: '2022-01-22T00:00:00Z', value: 0},
  992. {name: '2022-01-23T00:00:00Z', value: 0},
  993. {name: '2022-01-24T00:00:00Z', value: 0},
  994. {name: '2022-01-25T00:00:00Z', value: 0},
  995. {name: '2022-01-26T00:00:00Z', value: 0},
  996. {name: '2022-01-27T00:00:00Z', value: 0},
  997. {name: '2022-01-28T00:00:00Z', value: 0},
  998. ],
  999. },
  1000. {
  1001. seriesName: 'abnormal, 2 : count_crashed(session)',
  1002. data: [
  1003. {name: '2022-01-15T00:00:00Z', value: 0},
  1004. {name: '2022-01-16T00:00:00Z', value: 0},
  1005. {name: '2022-01-17T00:00:00Z', value: 0},
  1006. {name: '2022-01-18T00:00:00Z', value: 0},
  1007. {name: '2022-01-19T00:00:00Z', value: 0},
  1008. {name: '2022-01-20T00:00:00Z', value: 0},
  1009. {name: '2022-01-21T00:00:00Z', value: 0},
  1010. {name: '2022-01-22T00:00:00Z', value: 0},
  1011. {name: '2022-01-23T00:00:00Z', value: 0},
  1012. {name: '2022-01-24T00:00:00Z', value: 0},
  1013. {name: '2022-01-25T00:00:00Z', value: 0},
  1014. {name: '2022-01-26T00:00:00Z', value: 0},
  1015. {name: '2022-01-27T00:00:00Z', value: 0},
  1016. {name: '2022-01-28T00:00:00Z', value: 0},
  1017. ],
  1018. },
  1019. {
  1020. seriesName: 'errored, 2 : count_unique(user)',
  1021. data: [
  1022. {name: '2022-01-15T00:00:00Z', value: 1},
  1023. {name: '2022-01-16T00:00:00Z', value: 0},
  1024. {name: '2022-01-17T00:00:00Z', value: 0},
  1025. {name: '2022-01-18T00:00:00Z', value: 0},
  1026. {name: '2022-01-19T00:00:00Z', value: 0},
  1027. {name: '2022-01-20T00:00:00Z', value: 1},
  1028. {name: '2022-01-21T00:00:00Z', value: 0},
  1029. {name: '2022-01-22T00:00:00Z', value: 0},
  1030. {name: '2022-01-23T00:00:00Z', value: 0},
  1031. {name: '2022-01-24T00:00:00Z', value: 1},
  1032. {name: '2022-01-25T00:00:00Z', value: 1},
  1033. {name: '2022-01-26T00:00:00Z', value: 0},
  1034. {name: '2022-01-27T00:00:00Z', value: 0},
  1035. {name: '2022-01-28T00:00:00Z', value: 0},
  1036. ],
  1037. },
  1038. {
  1039. seriesName: 'errored, 2 : count_crashed(session)',
  1040. data: [
  1041. {name: '2022-01-15T00:00:00Z', value: 0},
  1042. {name: '2022-01-16T00:00:00Z', value: 0},
  1043. {name: '2022-01-17T00:00:00Z', value: 0},
  1044. {name: '2022-01-18T00:00:00Z', value: 0},
  1045. {name: '2022-01-19T00:00:00Z', value: 0},
  1046. {name: '2022-01-20T00:00:00Z', value: 0},
  1047. {name: '2022-01-21T00:00:00Z', value: 0},
  1048. {name: '2022-01-22T00:00:00Z', value: 0},
  1049. {name: '2022-01-23T00:00:00Z', value: 0},
  1050. {name: '2022-01-24T00:00:00Z', value: 0},
  1051. {name: '2022-01-25T00:00:00Z', value: 0},
  1052. {name: '2022-01-26T00:00:00Z', value: 0},
  1053. {name: '2022-01-27T00:00:00Z', value: 0},
  1054. {name: '2022-01-28T00:00:00Z', value: 0},
  1055. ],
  1056. },
  1057. {
  1058. seriesName: 'healthy, 2 : count_unique(user)',
  1059. data: [
  1060. {name: '2022-01-15T00:00:00Z', value: 1},
  1061. {name: '2022-01-16T00:00:00Z', value: 0},
  1062. {name: '2022-01-17T00:00:00Z', value: 0},
  1063. {name: '2022-01-18T00:00:00Z', value: 0},
  1064. {name: '2022-01-19T00:00:00Z', value: 0},
  1065. {name: '2022-01-20T00:00:00Z', value: 10},
  1066. {name: '2022-01-21T00:00:00Z', value: 3},
  1067. {name: '2022-01-22T00:00:00Z', value: 0},
  1068. {name: '2022-01-23T00:00:00Z', value: 0},
  1069. {name: '2022-01-24T00:00:00Z', value: 4},
  1070. {name: '2022-01-25T00:00:00Z', value: 3},
  1071. {name: '2022-01-26T00:00:00Z', value: 0},
  1072. {name: '2022-01-27T00:00:00Z', value: 0},
  1073. {name: '2022-01-28T00:00:00Z', value: 0},
  1074. ],
  1075. },
  1076. {
  1077. seriesName: 'healthy, 2 : count_crashed(session)',
  1078. data: [
  1079. {name: '2022-01-15T00:00:00Z', value: 0},
  1080. {name: '2022-01-16T00:00:00Z', value: 0},
  1081. {name: '2022-01-17T00:00:00Z', value: 0},
  1082. {name: '2022-01-18T00:00:00Z', value: 0},
  1083. {name: '2022-01-19T00:00:00Z', value: 0},
  1084. {name: '2022-01-20T00:00:00Z', value: 0},
  1085. {name: '2022-01-21T00:00:00Z', value: 0},
  1086. {name: '2022-01-22T00:00:00Z', value: 0},
  1087. {name: '2022-01-23T00:00:00Z', value: 0},
  1088. {name: '2022-01-24T00:00:00Z', value: 0},
  1089. {name: '2022-01-25T00:00:00Z', value: 0},
  1090. {name: '2022-01-26T00:00:00Z', value: 0},
  1091. {name: '2022-01-27T00:00:00Z', value: 0},
  1092. {name: '2022-01-28T00:00:00Z', value: 0},
  1093. ],
  1094. },
  1095. ]);
  1096. });
  1097. it('returns a single series with 0 as values when there are no groups returned', () => {
  1098. expect(
  1099. transformSessionsResponseToSeries(SessionEmptyGroupedResponse(), [], [])
  1100. ).toEqual([
  1101. {
  1102. seriesName: '(no results)',
  1103. data: [
  1104. {name: '2022-01-15T00:00:00Z', value: 0},
  1105. {name: '2022-01-16T00:00:00Z', value: 0},
  1106. {name: '2022-01-17T00:00:00Z', value: 0},
  1107. {name: '2022-01-18T00:00:00Z', value: 0},
  1108. {name: '2022-01-19T00:00:00Z', value: 0},
  1109. {name: '2022-01-20T00:00:00Z', value: 0},
  1110. {name: '2022-01-21T00:00:00Z', value: 0},
  1111. {name: '2022-01-22T00:00:00Z', value: 0},
  1112. {name: '2022-01-23T00:00:00Z', value: 0},
  1113. {name: '2022-01-24T00:00:00Z', value: 0},
  1114. {name: '2022-01-25T00:00:00Z', value: 0},
  1115. {name: '2022-01-26T00:00:00Z', value: 0},
  1116. {name: '2022-01-27T00:00:00Z', value: 0},
  1117. {name: '2022-01-28T00:00:00Z', value: 0},
  1118. ],
  1119. },
  1120. ]);
  1121. });
  1122. it('supports legend aliases', () => {
  1123. expect(
  1124. transformSessionsResponseToSeries(
  1125. SessionUserCountByStatusByRelease(),
  1126. [],
  1127. [],
  1128. 'Lorem'
  1129. )[0]
  1130. ).toEqual(
  1131. expect.objectContaining({
  1132. seriesName: 'Lorem > crashed, 1 : sum(session)',
  1133. })
  1134. );
  1135. });
  1136. });