fix: read Static and disable quality when a system setting withholds the scene
This commit is contained in:
@@ -94,12 +94,16 @@ const statusText = computed(() => {
|
|||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
/** The scene was lost or never started: the quality choice has nothing to
|
/** The scene was lost, never started, or is withheld by a system setting
|
||||||
* act on, so it reads Static and is disabled rather than claiming High. */
|
* (reduced motion, data saver): the quality choice has nothing to act on, so
|
||||||
|
* it reads Static and is disabled rather than claiming High. Visitor choices
|
||||||
|
* (pause, saved Static) keep it enabled so they can be changed back. */
|
||||||
const visualsUnavailable = computed(
|
const visualsUnavailable = computed(
|
||||||
() =>
|
() =>
|
||||||
props.policy.reason === "full" &&
|
props.policy.reason === "system-reduce" ||
|
||||||
(props.sceneStatus === "failed" || props.sceneStatus === "static"),
|
props.policy.reason === "data-saver" ||
|
||||||
|
(props.policy.reason === "full" &&
|
||||||
|
(props.sceneStatus === "failed" || props.sceneStatus === "static")),
|
||||||
);
|
);
|
||||||
|
|
||||||
const runAction = (): void => {
|
const runAction = (): void => {
|
||||||
|
|||||||
@@ -390,6 +390,25 @@ describe("DriveControls", () => {
|
|||||||
expect(select.element.value).toBe("static");
|
expect(select.element.value).toBe("static");
|
||||||
wrapper.unmount();
|
wrapper.unmount();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each(["system-reduce", "data-saver"] as const)(
|
||||||
|
"disables the quality choice and reads Static under %s",
|
||||||
|
async (reason) => {
|
||||||
|
const wrapper = mount(DriveControls, {
|
||||||
|
props: {
|
||||||
|
policy: policy({ reason, allowSceneRequest: false, allowAutomaticVideo: false, maximumTier: "static" }),
|
||||||
|
maximumQuality: "high",
|
||||||
|
sceneStatus: "idle",
|
||||||
|
audioState: { kind: "idle" },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await wrapper.get('[aria-label="Drive settings"]').trigger("click");
|
||||||
|
const select = wrapper.get<HTMLSelectElement>('[aria-label="Quality control"]');
|
||||||
|
expect(select.element.disabled).toBe(true);
|
||||||
|
expect(select.element.value).toBe("static");
|
||||||
|
wrapper.unmount();
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("JourneyHud", () => {
|
describe("JourneyHud", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user