review: Keep previous behavior for now to always auto switch
This commit is contained in:
@@ -101,21 +101,24 @@ test("Can manually force grid when there is a screenshare", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Should not auto-switch after manually selected grid", () => {
|
test("Should auto-switch after manually selected grid", () => {
|
||||||
withTestScheduler(({ cold, behavior, expectObservable, schedule }): void => {
|
withTestScheduler(({ cold, behavior, expectObservable, schedule }): void => {
|
||||||
const { gridMode$, setGridMode } = createLayoutModeSwitch(
|
const { gridMode$, setGridMode } = createLayoutModeSwitch(
|
||||||
scope,
|
scope,
|
||||||
behavior("n", { n: "normal" }),
|
behavior("n", { n: "normal" }),
|
||||||
|
// Two screenshares will happen in sequence
|
||||||
cold("-ft-ft", { f: false, t: true }),
|
cold("-ft-ft", { f: false, t: true }),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// There was a screen-share that forced spotlight, then
|
||||||
|
// the user manually switch back to grid
|
||||||
schedule("---g", {
|
schedule("---g", {
|
||||||
g: () => setGridMode("grid"),
|
g: () => setGridMode("grid"),
|
||||||
});
|
});
|
||||||
|
|
||||||
const expectation = "ggsg";
|
// If we did want to respect manual selection, the expectation would be:
|
||||||
// If we did not respect manual selection, the expectation would be:
|
// const expectation = "ggsg";
|
||||||
// const expectation = "ggsg-s";
|
const expectation = "ggsg-s";
|
||||||
|
|
||||||
expectObservable(gridMode$).toBe(expectation, {
|
expectObservable(gridMode$).toBe(expectation, {
|
||||||
g: "grid",
|
g: "grid",
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ export function createLayoutModeSwitch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Respect user's grid choice
|
// Respect user's grid choice
|
||||||
// XXX If we want to allow switching automatically again after we can
|
// XXX If we want to forbid switching automatically again after we can
|
||||||
// return hasAutoSwitched: false here instead of keeping the previous value.
|
// return hasAutoSwitched: acc.hasAutoSwitched here instead of setting to false.
|
||||||
return { mode: "grid", hasAutoSwitched: acc.hasAutoSwitched };
|
return { mode: "grid", hasAutoSwitched: false };
|
||||||
},
|
},
|
||||||
// initial value
|
// initial value
|
||||||
{ mode: "grid", hasAutoSwitched: false },
|
{ mode: "grid", hasAutoSwitched: false },
|
||||||
|
|||||||
Reference in New Issue
Block a user