Keyboard Helpers

  it('should toggle the content when pressing "Enter"', () => {
    host = createHost(`<zippy title="Zippy title"></zippy>`);
    host.keyboard.pressEnter(".zippy__title");
    expect(host.query(".zippy__content")).toExist();

    host.keyboard.pressEnter(".zippy__title");
    expect(".zippy__content").not.toExist();
  });

   it('should toggle the content when pressing "Escape"', () => {
      host = createHost(`<zippy title="Zippy title"></zippy>`);
      host.keyboard.pressEscape(".zippy__title");
      expect(host.query(".zippy__content")).toExist();

      host.keyboard.pressEscape(".zippy__title");
      // host.keyboard.pressTab(".zippy__title");
      // host.keyboard.pressBackspace(".zippy__title");
      expect(".zippy__content").not.toExist();
    });

results matching ""

    No results matching ""