chore(vendor): import pi 1.3.0
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
@@ -218,13 +218,15 @@ describe("session selector path/delete interactions", () => {
|
||||
|
||||
it("does not start redundant All loads when toggling scopes while All is already loading", async () => {
|
||||
const currentSessions = [makeSession({ id: "current" })];
|
||||
const allSessions = [makeSession({ id: "all" })];
|
||||
const allDeferred = createDeferred<SessionInfo[]>();
|
||||
let allLoadCalls = 0;
|
||||
|
||||
const selector = new SessionSelectorComponent(
|
||||
async () => currentSessions,
|
||||
async () => {
|
||||
async (onProgress) => {
|
||||
allLoadCalls++;
|
||||
onProgress?.(1, 2, allSessions);
|
||||
return allDeferred.promise;
|
||||
},
|
||||
() => {},
|
||||
@@ -241,8 +243,10 @@ describe("session selector path/delete interactions", () => {
|
||||
list.handleInput("\t"); // current -> all again while load pending
|
||||
|
||||
expect(allLoadCalls).toBe(1);
|
||||
expect(selector.getSessionList().getSelectedSessionPath()).toBe(allSessions[0]!.path);
|
||||
expect(selector.render(120).join("\n")).toContain("Loading");
|
||||
|
||||
allDeferred.resolve([makeSession({ id: "all" })]);
|
||||
allDeferred.resolve(allSessions);
|
||||
await flushPromises();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user