| 1 |
// Copyright (c) Jupyter Development Team. |
| 2 |
// Distributed under the terms of the Modified BSD License. |
| 3 |
|
| 4 |
import { every } from '@lumino/algorithm'; |
| 5 |
import { MessageLoop } from '@lumino/messaging'; |
| 6 |
import { |
| 7 |
AccordionLayout, |
| 8 |
AccordionPanel, |
| 9 |
Title, |
| 10 |
Widget |
| 11 |
} from '@lumino/widgets'; |
| 12 |
import { expect } from 'chai'; |
| 13 |
|
| 14 |
const bubbles = true; |
| 15 |
const renderer: AccordionPanel.IRenderer = { |
| 16 |
titleClassName: '.lm-AccordionTitle', |
| 17 |
createHandle: () => document.createElement('div'), |
| 18 |
createSectionTitle: (title: Title<Widget>) => document.createElement('h3') |
| 19 |
}; |
| 20 |
|
| 21 |
class LogAccordionPanel extends AccordionPanel { |
| 22 |
events: string[] = []; |
| 23 |
|
| 24 |
handleEvent(event: Event): void { |
| 25 |
super.handleEvent(event); |
| 26 |
this.events.push(event.type); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
describe('@lumino/widgets', () => { |
| 31 |
describe('AccordionPanel', () => { |
| 32 |
describe('#constructor()', () => { |
| 33 |
it('should accept no arguments', () => { |
| 34 |
let panel = new AccordionPanel(); |
| 35 |
expect(panel).to.be.an.instanceof(AccordionPanel); |
| 36 |
}); |
| 37 |
|
| 38 |
it('should accept options', () => { |
| 39 |
let panel = new AccordionPanel({ |
| 40 |
orientation: 'horizontal', |
| 41 |
spacing: 5, |
| 42 |
titleSpace: 42, |
| 43 |
renderer |
| 44 |
}); |
| 45 |
expect(panel.orientation).to.equal('horizontal'); |
| 46 |
expect(panel.spacing).to.equal(5); |
| 47 |
expect(panel.titleSpace).to.equal(42); |
| 48 |
expect(panel.renderer).to.equal(renderer); |
| 49 |
}); |
| 50 |
|
| 51 |
it('should accept a layout option', () => { |
| 52 |
let layout = new AccordionLayout({ renderer }); |
| 53 |
let panel = new AccordionPanel({ layout }); |
| 54 |
expect(panel.layout).to.equal(layout); |
| 55 |
}); |
| 56 |
|
| 57 |
it('should ignore other options if a layout is given', () => { |
| 58 |
let ignored = Object.create(renderer); |
| 59 |
let layout = new AccordionLayout({ renderer }); |
| 60 |
let panel = new AccordionPanel({ |
| 61 |
layout, |
| 62 |
orientation: 'horizontal', |
| 63 |
spacing: 5, |
| 64 |
titleSpace: 42, |
| 65 |
renderer: ignored |
| 66 |
}); |
| 67 |
expect(panel.layout).to.equal(layout); |
| 68 |
expect(panel.orientation).to.equal('vertical'); |
| 69 |
expect(panel.spacing).to.equal(4); |
| 70 |
expect(panel.titleSpace).to.equal(22); |
| 71 |
expect(panel.renderer).to.equal(renderer); |
| 72 |
}); |
| 73 |
|
| 74 |
it('should add the `lm-AccordionPanel` class', () => { |
| 75 |
let panel = new AccordionPanel(); |
| 76 |
expect(panel.hasClass('lm-AccordionPanel')).to.equal(true); |
| 77 |
}); |
| 78 |
}); |
| 79 |
|
| 80 |
describe('#accessibility()', () => { |
| 81 |
it('should create a widget ID if it does not exist', () => { |
| 82 |
let panel = new LogAccordionPanel(); |
| 83 |
let w1 = new Widget(); |
| 84 |
let w2 = new Widget(); |
| 85 |
|
| 86 |
// Expects a widget ID to be created. |
| 87 |
expect(w1.id).to.be.empty; |
| 88 |
panel.addWidget(w1); |
| 89 |
expect(w1.id).to.match(/id-[0-9a-z\-]+/); |
| 90 |
|
| 91 |
// Expects the widget ID to be unchanged. |
| 92 |
w2.id = 'test-id'; |
| 93 |
panel.addWidget(w2); |
| 94 |
expect(w2.id).to.equal('test-id'); |
| 95 |
}); |
| 96 |
|
| 97 |
it('should link the widget to its title', () => { |
| 98 |
let layout = new AccordionLayout({ renderer }); |
| 99 |
let panel = new LogAccordionPanel({ layout }); |
| 100 |
let w = new Widget(); |
| 101 |
panel.addWidget(w); |
| 102 |
|
| 103 |
expect(layout.titles[0].getAttribute('aria-controls')).to.equal(w.id); |
| 104 |
expect(layout.widgets[0].node.getAttribute('aria-labelledby')).to.equal( |
| 105 |
layout.titles[0].id |
| 106 |
); |
| 107 |
}); |
| 108 |
}); |
| 109 |
|
| 110 |
describe('#dispose()', () => { |
| 111 |
it('should dispose of the resources held by the panel', () => { |
| 112 |
let panel = new LogAccordionPanel(); |
| 113 |
let layout = panel.layout as AccordionLayout; |
| 114 |
let widgets = [new Widget(), new Widget(), new Widget()]; |
| 115 |
widgets.forEach(w => { |
| 116 |
panel.addWidget(w); |
| 117 |
}); |
| 118 |
Widget.attach(panel, document.body); |
| 119 |
|
| 120 |
panel.dispose(); |
| 121 |
|
| 122 |
expect(every(widgets, w => w.isDisposed)); |
| 123 |
expect(layout.titles).to.have.length(0); |
| 124 |
}); |
| 125 |
}); |
| 126 |
|
| 127 |
describe('#titleSpace', () => { |
| 128 |
it('should default to `22`', () => { |
| 129 |
let panel = new AccordionPanel(); |
| 130 |
expect(panel.titleSpace).to.equal(22); |
| 131 |
}); |
| 132 |
|
| 133 |
it('should set the titleSpace for the panel', () => { |
| 134 |
let panel = new AccordionPanel(); |
| 135 |
panel.titleSpace = 10; |
| 136 |
expect(panel.titleSpace).to.equal(10); |
| 137 |
}); |
| 138 |
}); |
| 139 |
|
| 140 |
describe('#renderer', () => { |
| 141 |
it('should get the renderer for the panel', () => { |
| 142 |
let panel = new AccordionPanel({ renderer }); |
| 143 |
expect(panel.renderer).to.equal(renderer); |
| 144 |
}); |
| 145 |
}); |
| 146 |
|
| 147 |
describe('#titles', () => { |
| 148 |
it('should get the read-only sequence of the accordion titles in the panel', () => { |
| 149 |
let panel = new AccordionPanel(); |
| 150 |
let widgets = [new Widget(), new Widget(), new Widget()]; |
| 151 |
widgets.forEach(w => { |
| 152 |
panel.addWidget(w); |
| 153 |
}); |
| 154 |
expect(panel.titles.length).to.equal(widgets.length); |
| 155 |
}); |
| 156 |
|
| 157 |
it('should update the title element', () => { |
| 158 |
const text = 'Something'; |
| 159 |
let panel = new AccordionPanel(); |
| 160 |
let widget = new Widget(); |
| 161 |
panel.addWidget(widget); |
| 162 |
widget.title.label = text; |
| 163 |
const el = panel.titles[0].querySelector( |
| 164 |
'.lm-AccordionPanel-titleLabel' |
| 165 |
)!; |
| 166 |
expect(el.textContent).to.equal(text); |
| 167 |
}); |
| 168 |
}); |
| 169 |
|
| 170 |
describe('#collapse()', () => { |
| 171 |
let panel: AccordionPanel; |
| 172 |
let layout: AccordionLayout; |
| 173 |
|
| 174 |
beforeEach(() => { |
| 175 |
panel = new AccordionPanel(); |
| 176 |
layout = panel.layout as AccordionLayout; |
| 177 |
let widgets = [new Widget(), new Widget(), new Widget()]; |
| 178 |
widgets.forEach(w => { |
| 179 |
panel.addWidget(w); |
| 180 |
}); |
| 181 |
panel.setRelativeSizes([10, 10, 10, 20]); |
| 182 |
Widget.attach(panel, document.body); |
| 183 |
MessageLoop.flush(); |
| 184 |
}); |
| 185 |
|
| 186 |
afterEach(() => { |
| 187 |
panel.dispose(); |
| 188 |
}); |
| 189 |
|
| 190 |
it('should collapse an expanded widget', () => { |
| 191 |
panel.collapse(1); |
| 192 |
|
| 193 |
expect(layout.titles[1].getAttribute('aria-expanded')).to.equal( |
| 194 |
'false' |
| 195 |
); |
| 196 |
expect(layout.titles[1].classList.contains('lm-mod-expanded')).to.be |
| 197 |
.false; |
| 198 |
expect(layout.widgets[1].isHidden).to.be.true; |
| 199 |
}); |
| 200 |
}); |
| 201 |
|
| 202 |
describe('#expand()', () => { |
| 203 |
let panel: AccordionPanel; |
| 204 |
let layout: AccordionLayout; |
| 205 |
|
| 206 |
beforeEach(() => { |
| 207 |
panel = new AccordionPanel(); |
| 208 |
layout = panel.layout as AccordionLayout; |
| 209 |
let widgets = [new Widget(), new Widget(), new Widget()]; |
| 210 |
widgets.forEach(w => { |
| 211 |
panel.addWidget(w); |
| 212 |
}); |
| 213 |
panel.setRelativeSizes([10, 10, 10, 20]); |
| 214 |
Widget.attach(panel, document.body); |
| 215 |
MessageLoop.flush(); |
| 216 |
}); |
| 217 |
|
| 218 |
afterEach(() => { |
| 219 |
panel.dispose(); |
| 220 |
}); |
| 221 |
|
| 222 |
it('should expand a collapsed widget', () => { |
| 223 |
panel.collapse(1); |
| 224 |
panel.expand(1); |
| 225 |
|
| 226 |
expect(layout.titles[0].getAttribute('aria-expanded')).to.equal('true'); |
| 227 |
expect(layout.titles[0].classList.contains('lm-mod-expanded')).to.be |
| 228 |
.true; |
| 229 |
expect(layout.widgets[0].isHidden).to.be.false; |
| 230 |
}); |
| 231 |
}); |
| 232 |
|
| 233 |
describe('#expansionToggled', () => { |
| 234 |
let panel: AccordionPanel; |
| 235 |
|
| 236 |
beforeEach(() => { |
| 237 |
panel = new AccordionPanel(); |
| 238 |
let widgets = [new Widget(), new Widget(), new Widget()]; |
| 239 |
widgets.forEach(w => { |
| 240 |
panel.addWidget(w); |
| 241 |
}); |
| 242 |
panel.setRelativeSizes([10, 10, 10, 20]); |
| 243 |
Widget.attach(panel, document.body); |
| 244 |
MessageLoop.flush(); |
| 245 |
}); |
| 246 |
|
| 247 |
afterEach(() => { |
| 248 |
panel.dispose(); |
| 249 |
}); |
| 250 |
|
| 251 |
it('should be emitted when the a widget is collapsed', done => { |
| 252 |
panel.expansionToggled.connect((sender, _) => { |
| 253 |
expect(sender).to.equal(panel); |
| 254 |
done(); |
| 255 |
}); |
| 256 |
panel.collapse(0); |
| 257 |
}); |
| 258 |
|
| 259 |
it('should be emitted when the a widget is expanded', done => { |
| 260 |
// first collapse a widget |
| 261 |
panel.collapse(0); |
| 262 |
|
| 263 |
panel.expansionToggled.connect((sender, _) => { |
| 264 |
expect(sender).to.equal(panel); |
| 265 |
done(); |
| 266 |
}); |
| 267 |
panel.expand(0); |
| 268 |
}); |
| 269 |
}); |
| 270 |
|
| 271 |
describe('#handleEvent()', () => { |
| 272 |
let panel: LogAccordionPanel; |
| 273 |
let layout: AccordionLayout; |
| 274 |
|
| 275 |
beforeEach(() => { |
| 276 |
panel = new LogAccordionPanel(); |
| 277 |
layout = panel.layout as AccordionLayout; |
| 278 |
let widgets = [new Widget(), new Widget(), new Widget()]; |
| 279 |
widgets.forEach(w => { |
| 280 |
panel.addWidget(w); |
| 281 |
}); |
| 282 |
panel.setRelativeSizes([10, 10, 10, 20]); |
| 283 |
Widget.attach(panel, document.body); |
| 284 |
MessageLoop.flush(); |
| 285 |
}); |
| 286 |
|
| 287 |
afterEach(() => { |
| 288 |
panel.dispose(); |
| 289 |
}); |
| 290 |
|
| 291 |
context('click', () => { |
| 292 |
it('should collapse an expanded widget', () => { |
| 293 |
layout.titles[0].dispatchEvent(new MouseEvent('click', { bubbles })); |
| 294 |
expect(panel.events).to.contain('click'); |
| 295 |
|
| 296 |
expect(layout.titles[0].getAttribute('aria-expanded')).to.equal( |
| 297 |
'false' |
| 298 |
); |
| 299 |
expect(layout.titles[0].classList.contains('lm-mod-expanded')).to.be |
| 300 |
.false; |
| 301 |
expect(layout.widgets[0].isHidden).to.be.true; |
| 302 |
}); |
| 303 |
|
| 304 |
it('should expand a collapsed widget', () => { |
| 305 |
// Collapse. |
| 306 |
layout.titles[0].dispatchEvent(new MouseEvent('click', { bubbles })); |
| 307 |
// Expand. |
| 308 |
layout.titles[0].dispatchEvent(new MouseEvent('click', { bubbles })); |
| 309 |
|
| 310 |
expect(layout.titles[0].getAttribute('aria-expanded')).to.equal( |
| 311 |
'true' |
| 312 |
); |
| 313 |
expect(layout.titles[0].classList.contains('lm-mod-expanded')).to.be |
| 314 |
.true; |
| 315 |
expect(layout.widgets[0].isHidden).to.be.false; |
| 316 |
}); |
| 317 |
}); |
| 318 |
|
| 319 |
context('keydown', () => { |
| 320 |
it('should redirect to toggle expansion state if Space is pressed', () => { |
| 321 |
layout.titles[0].dispatchEvent( |
| 322 |
new KeyboardEvent('keydown', { |
| 323 |
bubbles, |
| 324 |
key: 'Space' |
| 325 |
}) |
| 326 |
); |
| 327 |
expect(panel.events).to.contain('keydown'); |
| 328 |
|
| 329 |
expect(layout.titles[0].getAttribute('aria-expanded')).to.equal( |
| 330 |
'false' |
| 331 |
); |
| 332 |
expect(layout.titles[0].classList.contains('lm-mod-expanded')).to.be |
| 333 |
.false; |
| 334 |
expect(layout.widgets[0].isHidden).to.be.true; |
| 335 |
|
| 336 |
layout.titles[0].dispatchEvent( |
| 337 |
new KeyboardEvent('keydown', { |
| 338 |
bubbles, |
| 339 |
key: 'Space' |
| 340 |
}) |
| 341 |
); |
| 342 |
expect(panel.events).to.contain('keydown'); |
| 343 |
|
| 344 |
expect(layout.titles[0].getAttribute('aria-expanded')).to.equal( |
| 345 |
'true' |
| 346 |
); |
| 347 |
expect(layout.titles[0].classList.contains('lm-mod-expanded')).to.be |
| 348 |
.true; |
| 349 |
expect(layout.widgets[0].isHidden).to.be.false; |
| 350 |
}); |
| 351 |
|
| 352 |
it('should redirect to toggle expansion state if Enter is pressed', () => { |
| 353 |
layout.titles[0].dispatchEvent( |
| 354 |
new KeyboardEvent('keydown', { |
| 355 |
bubbles, |
| 356 |
key: 'Enter' |
| 357 |
}) |
| 358 |
); |
| 359 |
expect(panel.events).to.contain('keydown'); |
| 360 |
|
| 361 |
expect(layout.titles[0].getAttribute('aria-expanded')).to.equal( |
| 362 |
'false' |
| 363 |
); |
| 364 |
expect(layout.titles[0].classList.contains('lm-mod-expanded')).to.be |
| 365 |
.false; |
| 366 |
expect(layout.widgets[0].isHidden).to.be.true; |
| 367 |
|
| 368 |
layout.titles[0].dispatchEvent( |
| 369 |
new KeyboardEvent('keydown', { |
| 370 |
bubbles, |
| 371 |
key: 'Enter' |
| 372 |
}) |
| 373 |
); |
| 374 |
expect(panel.events).to.contain('keydown'); |
| 375 |
|
| 376 |
expect(layout.titles[0].getAttribute('aria-expanded')).to.equal( |
| 377 |
'true' |
| 378 |
); |
| 379 |
expect(layout.titles[0].classList.contains('lm-mod-expanded')).to.be |
| 380 |
.true; |
| 381 |
expect(layout.widgets[0].isHidden).to.be.false; |
| 382 |
}); |
| 383 |
|
| 384 |
it('should focus on the next widget if Arrow Down is pressed', () => { |
| 385 |
layout.titles[1].focus(); |
| 386 |
layout.titles[1].dispatchEvent( |
| 387 |
new KeyboardEvent('keydown', { |
| 388 |
bubbles, |
| 389 |
key: 'ArrowDown' |
| 390 |
}) |
| 391 |
); |
| 392 |
expect(panel.events).to.contain('keydown'); |
| 393 |
|
| 394 |
expect(document.activeElement).to.be.equal(layout.titles[2]); |
| 395 |
}); |
| 396 |
|
| 397 |
it('should focus on the previous widget if Arrow Up is pressed', () => { |
| 398 |
layout.titles[1].focus(); |
| 399 |
layout.titles[1].dispatchEvent( |
| 400 |
new KeyboardEvent('keydown', { |
| 401 |
bubbles, |
| 402 |
key: 'ArrowUp' |
| 403 |
}) |
| 404 |
); |
| 405 |
expect(panel.events).to.contain('keydown'); |
| 406 |
|
| 407 |
expect(document.activeElement).to.be.equal(layout.titles[0]); |
| 408 |
}); |
| 409 |
|
| 410 |
it('should focus on the first widget if Home is pressed', () => { |
| 411 |
layout.titles[1].focus(); |
| 412 |
layout.titles[1].dispatchEvent( |
| 413 |
new KeyboardEvent('keydown', { |
| 414 |
bubbles, |
| 415 |
key: 'Home' |
| 416 |
}) |
| 417 |
); |
| 418 |
expect(panel.events).to.contain('keydown'); |
| 419 |
|
| 420 |
expect(document.activeElement).to.be.equal(layout.titles[0]); |
| 421 |
}); |
| 422 |
|
| 423 |
it('should focus on the last widget if End is pressed', () => { |
| 424 |
layout.titles[1].focus(); |
| 425 |
layout.titles[1].dispatchEvent( |
| 426 |
new KeyboardEvent('keydown', { |
| 427 |
bubbles, |
| 428 |
key: 'End' |
| 429 |
}) |
| 430 |
); |
| 431 |
expect(panel.events).to.contain('keydown'); |
| 432 |
|
| 433 |
expect(document.activeElement).to.be.equal(layout.titles[2]); |
| 434 |
}); |
| 435 |
}); |
| 436 |
}); |
| 437 |
|
| 438 |
describe('#onBeforeAttach()', () => { |
| 439 |
it('should attach a click listener to the node', () => { |
| 440 |
let panel = new LogAccordionPanel(); |
| 441 |
Widget.attach(panel, document.body); |
| 442 |
panel.node.dispatchEvent(new MouseEvent('click', { bubbles })); |
| 443 |
expect(panel.events).to.contain('click'); |
| 444 |
panel.dispose(); |
| 445 |
}); |
| 446 |
|
| 447 |
it('should attach a keydown listener to the node', () => { |
| 448 |
let panel = new LogAccordionPanel(); |
| 449 |
Widget.attach(panel, document.body); |
| 450 |
panel.node.dispatchEvent(new KeyboardEvent('keydown', { bubbles })); |
| 451 |
expect(panel.events).to.contain('keydown'); |
| 452 |
panel.dispose(); |
| 453 |
}); |
| 454 |
}); |
| 455 |
|
| 456 |
describe('#onAfterDetach()', () => { |
| 457 |
it('should remove click listener', () => { |
| 458 |
let panel = new LogAccordionPanel(); |
| 459 |
Widget.attach(panel, document.body); |
| 460 |
panel.node.dispatchEvent(new MouseEvent('click', { bubbles })); |
| 461 |
expect(panel.events).to.contain('click'); |
| 462 |
|
| 463 |
Widget.detach(panel); |
| 464 |
|
| 465 |
panel.events = []; |
| 466 |
panel.node.dispatchEvent(new MouseEvent('click', { bubbles })); |
| 467 |
expect(panel.events).to.not.contain('click'); |
| 468 |
}); |
| 469 |
|
| 470 |
it('should remove keydown listener', () => { |
| 471 |
let panel = new LogAccordionPanel(); |
| 472 |
Widget.attach(panel, document.body); |
| 473 |
panel.node.dispatchEvent(new KeyboardEvent('keydown', { bubbles })); |
| 474 |
expect(panel.events).to.contain('keydown'); |
| 475 |
|
| 476 |
Widget.detach(panel); |
| 477 |
|
| 478 |
panel.events = []; |
| 479 |
panel.node.dispatchEvent(new KeyboardEvent('keydown', { bubbles })); |
| 480 |
expect(panel.events).to.not.contain('keydown'); |
| 481 |
}); |
| 482 |
}); |
| 483 |
|
| 484 |
describe('.Renderer()', () => { |
| 485 |
describe('.defaultRenderer', () => { |
| 486 |
it('should be an instance of `Renderer`', () => { |
| 487 |
expect(AccordionPanel.defaultRenderer).to.be.an.instanceof( |
| 488 |
AccordionPanel.Renderer |
| 489 |
); |
| 490 |
}); |
| 491 |
}); |
| 492 |
|
| 493 |
describe('#constructor', () => { |
| 494 |
it('should create a section title', () => { |
| 495 |
const renderer = new AccordionPanel.Renderer(); |
| 496 |
|
| 497 |
expect( |
| 498 |
renderer.createSectionTitle( |
| 499 |
new Title<Widget>({ owner: new Widget() }) |
| 500 |
) |
| 501 |
).to.be.instanceOf(HTMLElement); |
| 502 |
}); |
| 503 |
|
| 504 |
it('should have a section title selector', () => { |
| 505 |
const renderer = new AccordionPanel.Renderer(); |
| 506 |
|
| 507 |
expect(renderer.titleClassName).to.be.equal( |
| 508 |
'lm-AccordionPanel-title' |
| 509 |
); |
| 510 |
}); |
| 511 |
}); |
| 512 |
}); |
| 513 |
|
| 514 |
describe('#_computeWidgetSize()', () => { |
| 515 |
const DELTA = 1e-6; |
| 516 |
let panel: AccordionPanel; |
| 517 |
beforeEach(() => { |
| 518 |
panel = new AccordionPanel({ renderer, titleSpace: 0, spacing: 0 }); |
| 519 |
panel.node.style.height = '500px'; |
| 520 |
Widget.attach(panel, document.body); |
| 521 |
}); |
| 522 |
it('should not compute the size of panel with only one widget', () => { |
| 523 |
panel.addWidget(new Widget()); |
| 524 |
MessageLoop.flush(); |
| 525 |
const value = panel['_computeWidgetSize'](0); |
| 526 |
expect(value).to.be.equal(undefined); |
| 527 |
}); |
| 528 |
it('should compute the size of panel with two opened widgets', () => { |
| 529 |
const widgets = [new Widget(), new Widget()]; |
| 530 |
widgets.forEach(w => panel.addWidget(w)); |
| 531 |
MessageLoop.flush(); |
| 532 |
const value0 = panel['_computeWidgetSize'](0); |
| 533 |
expect(value0.length).to.be.equal(2); |
| 534 |
expect(value0[0]).to.be.closeTo(0, DELTA); |
| 535 |
expect(value0[1]).to.be.closeTo(1, DELTA); |
| 536 |
const value1 = panel['_computeWidgetSize'](1); |
| 537 |
expect(value1[0]).to.be.closeTo(1, DELTA); |
| 538 |
expect(value1[1]).to.be.closeTo(0, DELTA); |
| 539 |
}); |
| 540 |
it('should compute the size of panel with three widgets', () => { |
| 541 |
const widgets = [new Widget(), new Widget(), new Widget()]; |
| 542 |
widgets.forEach(w => panel.addWidget(w)); |
| 543 |
MessageLoop.flush(); |
| 544 |
|
| 545 |
const value = panel['_computeWidgetSize'](0); |
| 546 |
expect(value.length).to.be.equal(3); |
| 547 |
expect(value[0]).to.be.closeTo(0, DELTA); |
| 548 |
expect(value[1]).to.be.closeTo(0.333333, DELTA); |
| 549 |
expect(value[2]).to.be.closeTo(0.666666, DELTA); |
| 550 |
}); |
| 551 |
}); |
| 552 |
}); |
| 553 |
}); |