Beispiel #1
0
  it("should toggle correctly through stages if initially in indeterminate state", () => {
    const checkbox = new TriStateCheckbox(TristateState.indeterminate);

    checkbox.click();
    expect(checkbox.isChecked()).toBe(true);

    checkbox.click();
    expect(checkbox.isUnchecked()).toBe(true);

    checkbox.click();
    expect(checkbox.isIndeterminate()).toBe(true);

    checkbox.click();
    expect(checkbox.isChecked()).toBe(true);
  });
Beispiel #2
0
 it("should answer for indeterminate state check", () => {
   const checkbox = new TriStateCheckbox(TristateState.indeterminate);
   expect(checkbox.isIndeterminate()).toBe(true);
   expect(checkbox.isChecked()).toBe(false);
   expect(checkbox.isUnchecked()).toBe(false);
 });