transformSessionsResponseToSeries.spec.tsx 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  1. import {transformSessionsResponseToSeries} from 'sentry/views/dashboards/widgetCard/transformSessionsResponseToSeries';
  2. describe('transformSessionsResponseToSeries', function () {
  3. it('transforms sessions into series', () => {
  4. expect(
  5. transformSessionsResponseToSeries(
  6. TestStubs.SessionUserCountByStatusByRelease(),
  7. [],
  8. []
  9. )
  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. TestStubs.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. TestStubs.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(TestStubs.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. TestStubs.SessionUserCountByStatusByRelease(),
  1126. [],
  1127. [],
  1128. 'Lorem'
  1129. )[0]
  1130. ).toEqual(
  1131. expect.objectContaining({
  1132. seriesName: 'Lorem > crashed, 1 : sum(session)',
  1133. })
  1134. );
  1135. });
  1136. });