Add keyboard navigation for users, groups, branches, tags, sources, changesets and plugins (#2153)

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
Konstantin Schaper
2022-11-10 11:44:53 +01:00
committed by GitHub
parent da71004dd0
commit eea60deadb
28 changed files with 819 additions and 373 deletions

View File

@@ -88,7 +88,7 @@ describe("shortcutIterator", () => {
expect(result.error).toBeUndefined();
});
it("should call last callback upon pressing forward in initial state", async () => {
it("should call first callback upon pressing forward in initial state", async () => {
const callback = jest.fn();
const callback2 = jest.fn();
const callback3 = jest.fn();
@@ -101,12 +101,12 @@ describe("shortcutIterator", () => {
Mousetrap.trigger("j");
expect(callback).not.toHaveBeenCalled();
expect(callback).toHaveBeenCalledTimes(1);
expect(callback2).not.toHaveBeenCalled();
expect(callback3).toHaveBeenCalledTimes(1);
expect(callback3).not.toHaveBeenCalled();
});
it("should call first callback once upon pressing backward in initial state", async () => {
it("should call last callback once upon pressing backward in initial state", async () => {
const callback = jest.fn();
const callback2 = jest.fn();
const callback3 = jest.fn();
@@ -117,12 +117,11 @@ describe("shortcutIterator", () => {
</Wrapper>
);
Mousetrap.trigger("k");
Mousetrap.trigger("k");
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).not.toHaveBeenCalled();
expect(callback2).not.toHaveBeenCalled();
expect(callback3).not.toHaveBeenCalled();
expect(callback3).toHaveBeenCalledTimes(1);
});
it("should not allow moving past the end of the callback array", async () => {