mouse-operation.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. describe('mouse operation', function () {
  2. let clock;
  3. let input;
  4. before(function () {
  5. clock = sinon.useFakeTimers({now: new Date(2020, 1, 14)});
  6. input = document.createElement('input');
  7. testContainer.appendChild(input);
  8. });
  9. after(function () {
  10. clock.restore();
  11. testContainer.removeChild(input);
  12. });
  13. it('picker hides if mouse is pressed outside the picker or the input', function () {
  14. const outsider = document.createElement('p');
  15. testContainer.appendChild(outsider);
  16. const {dp, picker} = createDP(input);
  17. input.focus();
  18. simulant.fire(picker.querySelector('.dow'), 'mousedown');
  19. expect(isVisible(picker), 'to be true');
  20. simulant.fire(input, 'mousedown');
  21. expect(isVisible(picker), 'to be true');
  22. simulant.fire(outsider, 'mousedown');
  23. expect(isVisible(picker), 'to be false');
  24. // hide() should not called when picker is hidden
  25. // (issue #45)
  26. const spyHide = sinon.spy(dp, 'hide');
  27. input.blur();
  28. simulant.fire(outsider, 'mousedown');
  29. expect(spyHide.called, 'to be false');
  30. spyHide.restore();
  31. // picker shown programmatically should be closed by clicking outside
  32. // (issue #52)
  33. dp.show();
  34. simulant.fire(outsider, 'mousedown');
  35. expect(isVisible(picker), 'to be false');
  36. dp.destroy();
  37. testContainer.removeChild(outsider);
  38. });
  39. it('selection is updated with input\'s value if mouse is pressed outside the input', function () {
  40. const outsider = document.createElement('p');
  41. testContainer.appendChild(outsider);
  42. const {dp, picker} = createDP(input);
  43. // when picker is shown
  44. input.focus();
  45. input.value = 'foo';
  46. simulant.fire(picker.querySelector('.dow'), 'mousedown');
  47. expect(input.value, 'to be', 'foo');
  48. simulant.fire(input, 'mousedown');
  49. expect(input.value, 'to be', 'foo');
  50. simulant.fire(outsider, 'mousedown');
  51. expect(input.value, 'to be', '02/14/2020');
  52. expect(dp.getDate().getTime(), 'to be', dateValue(2020, 1, 14));
  53. // when picker is hidden
  54. input.focus();
  55. input.value = '04/22/2020';
  56. simulant.fire(outsider, 'mousedown');
  57. expect(input.value, 'to be', '04/22/2020');
  58. expect(dp.getDate().getTime(), 'to be', dateValue(2020, 3, 22));
  59. input.focus();
  60. input.value = '';
  61. simulant.fire(outsider, 'mousedown');
  62. expect(input.value, 'to be', '');
  63. expect(dp.getDate(), 'to be undefined');
  64. dp.destroy();
  65. testContainer.removeChild(outsider);
  66. });
  67. it('picker shows up if input field is clicked wheh picker is hidden', function () {
  68. const {dp, picker} = createDP(input);
  69. // when input field is not focued
  70. simulant.fire(input, 'mousedown');
  71. input.click();
  72. expect(isVisible(picker), 'to be true');
  73. dp.hide();
  74. // when input has focus
  75. simulant.fire(input, 'mousedown');
  76. input.click();
  77. expect(isVisible(picker), 'to be true');
  78. dp.destroy();
  79. });
  80. describe('view-switch', function () {
  81. it('changes the view to the next greater one', function () {
  82. input.value = '04/22/2020';
  83. const {dp, picker} = createDP(input);
  84. const viewSwitch = getViewSwitch(picker);
  85. dp.show();
  86. viewSwitch.click();
  87. expect(viewSwitch.textContent, 'to be', '2020');
  88. expect(input.value, 'to be', '04/22/2020');
  89. let cells = getCells(picker);
  90. expect(cells.map(el => el.textContent), 'to equal', Datepicker.locales.en.monthsShort);
  91. expect(cells[3].classList.contains('selected'), 'to be true');
  92. expect(cells[3].classList.contains('focused'), 'to be true');
  93. viewSwitch.click();
  94. expect(viewSwitch.textContent, 'to be', '2020-2029');
  95. expect(input.value, 'to be', '04/22/2020');
  96. cells = getCells(picker);
  97. expect(cells, 'to have length', 12);
  98. expect(cells[0].textContent, 'to be', '2019');
  99. expect(cells[0].classList.contains('prev'), 'to be true');
  100. expect(cells[0].classList.contains('next'), 'to be false');
  101. expect(cells[1].textContent, 'to be', '2020');
  102. expect(cells[1].classList.contains('prev'), 'to be false');
  103. expect(cells[1].classList.contains('next'), 'to be false');
  104. expect(cells[10].textContent, 'to be', '2029');
  105. expect(cells[10].classList.contains('prev'), 'to be false');
  106. expect(cells[10].classList.contains('next'), 'to be false');
  107. expect(cells[11].textContent, 'to be', '2030');
  108. expect(cells[11].classList.contains('prev'), 'to be false');
  109. expect(cells[11].classList.contains('next'), 'to be true');
  110. expect(filterCells(cells, '.selected'), 'to equal', [cells[1]]);
  111. expect(filterCells(cells, '.focused'), 'to equal', [cells[1]]);
  112. viewSwitch.click();
  113. expect(viewSwitch.textContent, 'to be', '2000-2090');
  114. expect(input.value, 'to be', '04/22/2020');
  115. cells = getCells(picker);
  116. expect(cells, 'to have length', 12);
  117. expect(cells[0].textContent, 'to be', '1990');
  118. expect(cells[0].classList.contains('prev'), 'to be true');
  119. expect(cells[0].classList.contains('next'), 'to be false');
  120. expect(cells[1].textContent, 'to be', '2000');
  121. expect(cells[1].classList.contains('prev'), 'to be false');
  122. expect(cells[1].classList.contains('next'), 'to be false');
  123. expect(cells[10].textContent, 'to be', '2090');
  124. expect(cells[10].classList.contains('prev'), 'to be false');
  125. expect(cells[10].classList.contains('next'), 'to be false');
  126. expect(cells[11].textContent, 'to be', '2100');
  127. expect(cells[11].classList.contains('prev'), 'to be false');
  128. expect(cells[11].classList.contains('next'), 'to be true');
  129. expect(filterCells(cells, '.selected'), 'to equal', [cells[3]]);
  130. expect(filterCells(cells, '.focused'), 'to equal', [cells[3]]);
  131. expect(cells[3].textContent, 'to be', '2020');
  132. // does nothig if the view has reached to the max view
  133. viewSwitch.click();
  134. expect(viewSwitch.textContent, 'to be', '2000-2090');
  135. dp.destroy();
  136. input.value = '';
  137. });
  138. });
  139. describe('prev-btn', function () {
  140. it('changes the month/year/decade/century of the view to the previouse one', function () {
  141. input.value = '04/22/2020';
  142. const {dp, picker} = createDP(input);
  143. const [viewSwitch, prevBtn] = getParts(picker, ['.view-switch', '.prev-btn']);
  144. dp.show();
  145. prevBtn.click();
  146. expect(viewSwitch.textContent, 'to be', 'March 2020');
  147. expect(input.value, 'to be', '04/22/2020');
  148. // view date is changed to the same day of the previous month
  149. let cells = getCells(picker);
  150. expect(cells, 'to have length', 42);
  151. expect(cells[0].textContent, 'to be', '1');
  152. expect(cells[0].classList.contains('prev'), 'to be false');
  153. expect(cells[0].classList.contains('next'), 'to be false');
  154. expect(cells[30].textContent, 'to be', '31');
  155. expect(cells[30].classList.contains('prev'), 'to be false');
  156. expect(cells[30].classList.contains('next'), 'to be false');
  157. expect(cells[31].textContent, 'to be', '1');
  158. expect(cells[31].classList.contains('prev'), 'to be false');
  159. expect(cells[31].classList.contains('next'), 'to be true');
  160. expect(cells[41].textContent, 'to be', '11');
  161. expect(cells[41].classList.contains('prev'), 'to be false');
  162. expect(cells[41].classList.contains('next'), 'to be true');
  163. expect(filterCells(cells, '.selected'), 'to equal', []);
  164. expect(filterCells(cells, '.focused'), 'to equal', [cells[21]]);
  165. expect(cells[21].textContent, 'to be', '22');
  166. viewSwitch.click();
  167. expect(viewSwitch.textContent, 'to be', '2020');
  168. cells = getCells(picker);
  169. expect(filterCells(cells, '.selected'), 'to equal', [cells[3]]);
  170. expect(filterCells(cells, '.focused'), 'to equal', [cells[2]]);
  171. prevBtn.click();
  172. expect(viewSwitch.textContent, 'to be', '2019');
  173. expect(input.value, 'to be', '04/22/2020');
  174. // view date is changed to the same month of the previous year
  175. cells = getCells(picker);
  176. expect(cells.map(el => el.textContent), 'to equal', Datepicker.locales.en.monthsShort);
  177. expect(filterCells(cells, '.selected'), 'to equal', []);
  178. expect(filterCells(cells, '.focused'), 'to equal', [cells[2]]);
  179. viewSwitch.click();
  180. expect(viewSwitch.textContent, 'to be', '2010-2019');
  181. cells = getCells(picker);
  182. expect(filterCells(cells, '.selected'), 'to equal', [cells[11]]);
  183. expect(cells[11].textContent, 'to be', '2020');
  184. expect(filterCells(cells, '.focused'), 'to equal', [cells[10]]);
  185. expect(cells[10].textContent, 'to be', '2019');
  186. prevBtn.click();
  187. expect(viewSwitch.textContent, 'to be', '2000-2009');
  188. expect(input.value, 'to be', '04/22/2020');
  189. cells = getCells(picker);
  190. expect(cells, 'to have length', 12);
  191. expect(cells[0].textContent, 'to be', '1999');
  192. expect(cells[1].textContent, 'to be', '2000');
  193. expect(cells[10].textContent, 'to be', '2009');
  194. expect(cells[11].textContent, 'to be', '2010');
  195. expect(filterCells(cells, '.selected'), 'to equal', []);
  196. expect(filterCells(cells, '.focused'), 'to equal', [cells[10]]);
  197. viewSwitch.click();
  198. expect(viewSwitch.textContent, 'to be', '2000-2090');
  199. cells = getCells(picker);
  200. expect(filterCells(cells, '.selected'), 'to equal', [cells[3]]);
  201. expect(cells[3].textContent, 'to be', '2020');
  202. expect(filterCells(cells, '.focused'), 'to equal', [cells[1]]);
  203. expect(cells[1].textContent, 'to be', '2000');
  204. prevBtn.click();
  205. expect(viewSwitch.textContent, 'to be', '1900-1990');
  206. expect(input.value, 'to be', '04/22/2020');
  207. cells = getCells(picker);
  208. expect(cells, 'to have length', 12);
  209. expect(cells[0].textContent, 'to be', '1890');
  210. expect(cells[1].textContent, 'to be', '1900');
  211. expect(cells[10].textContent, 'to be', '1990');
  212. expect(cells[11].textContent, 'to be', '2000');
  213. expect(filterCells(cells, '.selected'), 'to equal', []);
  214. expect(filterCells(cells, '.focused'), 'to equal', [cells[1]]);
  215. dp.destroy();
  216. input.value = '';
  217. });
  218. it('controls the view date in days view to be in the prev month when moving from a longer month to shorter', function () {
  219. input.value = '03/31/2019';
  220. const {dp, picker} = createDP(input);
  221. const [viewSwitch, prevBtn] = getParts(picker, ['.view-switch', '.prev-btn']);
  222. dp.show();
  223. prevBtn.click();
  224. expect(viewSwitch.textContent, 'to be', 'February 2019');
  225. let cells = getCells(picker);
  226. expect(filterCells(cells, '.focused'), 'to equal', [cells[32]]);
  227. expect(cells[32].textContent, 'to be', '28');
  228. input.value = '03/31/2020';
  229. dp.update();
  230. prevBtn.click();
  231. expect(viewSwitch.textContent, 'to be', 'February 2020');
  232. cells = getCells(picker);
  233. expect(filterCells(cells, '.focused'), 'to equal', [cells[34]]);
  234. expect(cells[34].textContent, 'to be', '29');
  235. input.value = '10/31/2020';
  236. dp.update();
  237. prevBtn.click();
  238. expect(viewSwitch.textContent, 'to be', 'September 2020');
  239. cells = getCells(picker);
  240. expect(filterCells(cells, '.focused'), 'to equal', [cells[31]]);
  241. expect(cells[31].textContent, 'to be', '30');
  242. dp.destroy();
  243. input.value = '';
  244. });
  245. it('becomes disabled if the view includes the decade/year/month/day of 0000-01-01', function () {
  246. input.value = '01/04/0000';
  247. const {dp, picker} = createDP(input);
  248. const [viewSwitch, prevBtn] = getParts(picker, ['.view-switch', '.prev-btn']);
  249. dp.show();
  250. expect(prevBtn.disabled, 'to be true');
  251. prevBtn.click();
  252. expect(viewSwitch.textContent, 'to be', 'January 0');
  253. viewSwitch.click();
  254. expect(prevBtn.disabled, 'to be true');
  255. prevBtn.click();
  256. expect(viewSwitch.textContent, 'to be', '0');
  257. viewSwitch.click();
  258. expect(prevBtn.disabled, 'to be true');
  259. prevBtn.click();
  260. expect(viewSwitch.textContent, 'to be', '0-9');
  261. viewSwitch.click();
  262. expect(prevBtn.disabled, 'to be true');
  263. prevBtn.click();
  264. expect(viewSwitch.textContent, 'to be', '0-90');
  265. dp.destroy();
  266. input.value = '';
  267. });
  268. });
  269. describe('next-btn', function () {
  270. it('changes the month/year/decade/century of the view to the next one', function () {
  271. input.value = '04/22/2020';
  272. const {dp, picker} = createDP(input);
  273. const [viewSwitch, nextBtn] = getParts(picker, ['.view-switch', '.next-btn']);
  274. dp.show();
  275. nextBtn.click();
  276. expect(viewSwitch.textContent, 'to be', 'May 2020');
  277. expect(input.value, 'to be', '04/22/2020');
  278. // view date is changed to the same day of the next month
  279. let cells = getCells(picker);
  280. expect(cells, 'to have length', 42);
  281. expect(cells[0].textContent, 'to be', '26');
  282. expect(cells[0].classList.contains('prev'), 'to be true');
  283. expect(cells[0].classList.contains('next'), 'to be false');
  284. expect(cells[4].textContent, 'to be', '30');
  285. expect(cells[4].classList.contains('prev'), 'to be true');
  286. expect(cells[4].classList.contains('next'), 'to be false');
  287. expect(cells[5].textContent, 'to be', '1');
  288. expect(cells[5].classList.contains('prev'), 'to be false');
  289. expect(cells[5].classList.contains('next'), 'to be false');
  290. expect(cells[35].textContent, 'to be', '31');
  291. expect(cells[35].classList.contains('prev'), 'to be false');
  292. expect(cells[35].classList.contains('next'), 'to be false');
  293. expect(cells[36].textContent, 'to be', '1');
  294. expect(cells[36].classList.contains('prev'), 'to be false');
  295. expect(cells[36].classList.contains('next'), 'to be true');
  296. expect(cells[41].textContent, 'to be', '6');
  297. expect(cells[41].classList.contains('prev'), 'to be false');
  298. expect(cells[41].classList.contains('next'), 'to be true');
  299. expect(filterCells(cells, '.selected'), 'to equal', []);
  300. expect(filterCells(cells, '.focused'), 'to equal', [cells[26]]);
  301. expect(cells[26].textContent, 'to be', '22');
  302. viewSwitch.click();
  303. expect(viewSwitch.textContent, 'to be', '2020');
  304. cells = getCells(picker);
  305. expect(filterCells(cells, '.selected'), 'to equal', [cells[3]]);
  306. expect(filterCells(cells, '.focused'), 'to equal', [cells[4]]);
  307. nextBtn.click();
  308. expect(viewSwitch.textContent, 'to be', '2021');
  309. expect(input.value, 'to be', '04/22/2020');
  310. // view date is changed to the same month of the previous year
  311. cells = getCells(picker);
  312. expect(cells.map(el => el.textContent), 'to equal', Datepicker.locales.en.monthsShort);
  313. expect(filterCells(cells, '.selected'), 'to equal', []);
  314. expect(filterCells(cells, '.focused'), 'to equal', [cells[4]]);
  315. viewSwitch.click();
  316. expect(viewSwitch.textContent, 'to be', '2020-2029');
  317. cells = getCells(picker);
  318. expect(filterCells(cells, '.selected'), 'to equal', [cells[1]]);
  319. expect(filterCells(cells, '.focused'), 'to equal', [cells[2]]);
  320. expect(cells[1].textContent, 'to be', '2020');
  321. expect(cells[2].textContent, 'to be', '2021');
  322. nextBtn.click();
  323. expect(viewSwitch.textContent, 'to be', '2030-2039');
  324. expect(input.value, 'to be', '04/22/2020');
  325. cells = getCells(picker);
  326. expect(cells, 'to have length', 12);
  327. expect(cells[0].textContent, 'to be', '2029');
  328. expect(cells[1].textContent, 'to be', '2030');
  329. expect(cells[10].textContent, 'to be', '2039');
  330. expect(cells[11].textContent, 'to be', '2040');
  331. expect(filterCells(cells, '.selected'), 'to equal', []);
  332. expect(filterCells(cells, '.focused'), 'to equal', [cells[2]]);
  333. expect(cells[2].textContent, 'to be', '2031');
  334. viewSwitch.click();
  335. expect(viewSwitch.textContent, 'to be', '2000-2090');
  336. cells = getCells(picker);
  337. expect(filterCells(cells, '.selected'), 'to equal', [cells[3]]);
  338. expect(filterCells(cells, '.focused'), 'to equal', [cells[4]]);
  339. expect(cells[3].textContent, 'to be', '2020');
  340. expect(cells[4].textContent, 'to be', '2030');
  341. nextBtn.click();
  342. expect(viewSwitch.textContent, 'to be', '2100-2190');
  343. expect(input.value, 'to be', '04/22/2020');
  344. cells = getCells(picker);
  345. expect(cells, 'to have length', 12);
  346. expect(cells[0].textContent, 'to be', '2090');
  347. expect(cells[1].textContent, 'to be', '2100');
  348. expect(cells[10].textContent, 'to be', '2190');
  349. expect(cells[11].textContent, 'to be', '2200');
  350. expect(filterCells(cells, '.selected'), 'to equal', []);
  351. expect(filterCells(cells, '.focused'), 'to equal', [cells[4]]);
  352. expect(cells[4].textContent, 'to be', '2130');
  353. dp.destroy();
  354. input.value = '';
  355. });
  356. it('controls the view date in days view to be in the next month when moving from a longer month to shorter', function () {
  357. input.value = '01/31/2019';
  358. const {dp, picker} = createDP(input);
  359. const [viewSwitch, nextBtn] = getParts(picker, ['.view-switch', '.next-btn']);
  360. dp.show();
  361. nextBtn.click();
  362. expect(viewSwitch.textContent, 'to be', 'February 2019');
  363. let cells = getCells(picker);
  364. expect(filterCells(cells, '.focused'), 'to equal', [cells[32]]);
  365. expect(cells[32].textContent, 'to be', '28');
  366. input.value = '01/31/2020';
  367. dp.update();
  368. nextBtn.click();
  369. expect(viewSwitch.textContent, 'to be', 'February 2020');
  370. cells = getCells(picker);
  371. expect(filterCells(cells, '.focused'), 'to equal', [cells[34]]);
  372. expect(cells[34].textContent, 'to be', '29');
  373. input.value = '08/31/2020';
  374. dp.update();
  375. nextBtn.click();
  376. expect(viewSwitch.textContent, 'to be', 'September 2020');
  377. cells = getCells(picker);
  378. expect(filterCells(cells, '.focused'), 'to equal', [cells[31]]);
  379. expect(cells[31].textContent, 'to be', '30');
  380. dp.destroy();
  381. input.value = '';
  382. });
  383. });
  384. describe('datepicker-cell', function () {
  385. let dp;
  386. let picker;
  387. beforeEach(function () {
  388. ({dp, picker} = createDP(input));
  389. dp.show();
  390. });
  391. afterEach(function () {
  392. dp.destroy();
  393. });
  394. it('changes the selection to the clicked date if the current view = days', function () {
  395. const targetCell = getCells(picker)[19];
  396. targetCell.click();
  397. expect(dp.dates, 'to equal', [new Date(2020, 1, 14).getTime()]);
  398. expect(input.value, 'to be', '02/14/2020');
  399. expect(getViewSwitch(picker).textContent, 'to be', 'February 2020');
  400. expect(targetCell.classList.contains('selected'), 'to be true');
  401. expect(targetCell.classList.contains('focused'), 'to be true');
  402. dp.setDate({clear: true});
  403. });
  404. it('also changes the month of the view if a date of previous or next month is clicked', function () {
  405. const viewSwitch = getViewSwitch(picker);
  406. getCells(picker)[1].click();
  407. expect(dp.dates, 'to equal', [new Date(2020, 0, 27).getTime()]);
  408. expect(input.value, 'to be', '01/27/2020');
  409. expect(viewSwitch.textContent, 'to be', 'January 2020');
  410. let cells = getCells(picker);
  411. expect(filterCells(cells, '.selected'), 'to equal', [cells[29]]);
  412. expect(filterCells(cells, '.focused'), 'to equal', [cells[29]]);
  413. expect(cells[29].textContent, 'to be', '27');
  414. expect(cells[40].textContent, 'to be', '7');
  415. cells[40].click();
  416. expect(dp.dates, 'to equal', [dateValue(2020, 1, 7)]);
  417. expect(input.value, 'to be', '02/07/2020');
  418. expect(viewSwitch.textContent, 'to be', 'February 2020');
  419. cells = getCells(picker);
  420. expect(filterCells(cells, '.selected'), 'to equal', [cells[12]]);
  421. expect(filterCells(cells, '.focused'), 'to equal', [cells[12]]);
  422. expect(cells[12].textContent, 'to be', '7');
  423. dp.setDate({clear: true});
  424. });
  425. it('changes the view year or month to the clicked one and moves to the next minor view if the current view != days', function () {
  426. const viewSwitch = getViewSwitch(picker);
  427. viewSwitch.click();
  428. viewSwitch.click();
  429. viewSwitch.click();
  430. viewSwitch.click();
  431. // on decades view: 2000-2090
  432. let cells = getCells(picker);
  433. // click "2010"
  434. cells[2].click();
  435. expect(dp.dates, 'to equal', []);
  436. expect(input.value, 'to be', '');
  437. expect(getViewSwitch(picker).textContent, 'to be', '2010-2019');
  438. cells = getCells(picker);
  439. expect(filterCells(cells, '.focused'), 'to equal', [cells[1]]);
  440. expect(cells[1].textContent, 'to be', '2010');
  441. // click "2017"
  442. cells[8].click();
  443. expect(dp.dates, 'to equal', []);
  444. expect(input.value, 'to be', '');
  445. expect(getViewSwitch(picker).textContent, 'to be', '2017');
  446. cells = getCells(picker);
  447. expect(filterCells(cells, '.focused'), 'to equal', [cells[1]]);
  448. expect(cells[1].textContent, 'to be', 'Feb');
  449. // click "Oct"
  450. cells[9].click();
  451. expect(dp.dates, 'to equal', []);
  452. expect(input.value, 'to be', '');
  453. expect(getViewSwitch(picker).textContent, 'to be', 'October 2017');
  454. cells = getCells(picker);
  455. expect(filterCells(cells, '.focused'), 'to equal', [cells[1]]);
  456. expect(cells[10].textContent, 'to be', '11');
  457. });
  458. });
  459. });