it("should toggle correctly through stages if initially in on/off state", () => { const checkbox = new TriStateCheckbox(TristateState.on); checkbox.click(); expect(checkbox.isUnchecked()).toBe(true); checkbox.click(); expect(checkbox.isChecked()).toBe(true); });
it("should tell if state is changed", () => { const checkbox = new TriStateCheckbox(TristateState.on); checkbox.click(); expect(checkbox.ischanged()).toBe(true); });
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); });
it("should return current state", () => { const checkbox = new TriStateCheckbox(TristateState.on); expect(checkbox.state()).toBe("on"); });