Skip to content

Commit

Permalink
call sessionBusy false at end of getServerInfo. added tests (#3219)
Browse files Browse the repository at this point in the history
* call sessionBusy false at end of getServerInfo. added tests

* ran format
  • Loading branch information
alexcottner authored Apr 17, 2024
1 parent 3a95325 commit 7fc445c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sagas/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function* getServerInfo(
)
);
}
yield put(actions.sessionBusy(false));
}

export function* setupSession(
Expand Down
8 changes: 8 additions & 0 deletions test/sagas/session_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ describe("session sagas", () => {
expect(getServerInfo.next(serverInfo).value).toMatchObject(
put(actions.serverInfoSuccess(serverInfo))
);
// ensure that sessionBusy is called
expect(getServerInfo.next().value).toStrictEqual(
put(actions.sessionBusy(false))
);
});

it("should split the auth if it's openID", () => {
Expand Down Expand Up @@ -140,6 +144,10 @@ describe("session sagas", () => {
"Could not reach server http://server.test/v1",
undefined
);
// ensure that sessionBusy is called
expect(getServerInfo.next().value).toStrictEqual(
put(actions.sessionBusy(false))
);
});
});

Expand Down

0 comments on commit 7fc445c

Please sign in to comment.