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 => {
|
||||
const { gridMode$, setGridMode } = createLayoutModeSwitch(
|
||||
scope,
|
||||
behavior("n", { n: "normal" }),
|
||||
// Two screenshares will happen in sequence
|
||||
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", {
|
||||
g: () => setGridMode("grid"),
|
||||
});
|
||||
|
||||
const expectation = "ggsg";
|
||||
// If we did not respect manual selection, the expectation would be:
|
||||
// const expectation = "ggsg-s";
|
||||
// If we did want to respect manual selection, the expectation would be:
|
||||
// const expectation = "ggsg";
|
||||
const expectation = "ggsg-s";
|
||||
|
||||
expectObservable(gridMode$).toBe(expectation, {
|
||||
g: "grid",
|
||||
|
||||
@@ -97,9 +97,9 @@ export function createLayoutModeSwitch(
|
||||
}
|
||||
|
||||
// Respect user's grid choice
|
||||
// XXX If we want to allow switching automatically again after we can
|
||||
// return hasAutoSwitched: false here instead of keeping the previous value.
|
||||
return { mode: "grid", hasAutoSwitched: acc.hasAutoSwitched };
|
||||
// XXX If we want to forbid switching automatically again after we can
|
||||
// return hasAutoSwitched: acc.hasAutoSwitched here instead of setting to false.
|
||||
return { mode: "grid", hasAutoSwitched: false };
|
||||
},
|
||||
// initial value
|
||||
{ mode: "grid", hasAutoSwitched: false },
|
||||
|
||||
Reference in New Issue
Block a user