fix(update-center): handle missing apm and restore scrolling

This commit is contained in:
2026-04-16 11:11:06 +08:00
parent 120233cf56
commit e1ec526cb9
4 changed files with 41 additions and 35 deletions
@@ -91,6 +91,34 @@ const createStore = (
};
describe("UpdateCenterModal", () => {
it("constrains the update list so it can scroll with a visible scrollbar", () => {
const store = createStore({
items: Array.from({ length: 20 }, (_, index) =>
createItem({
taskKey: `aptss:spark-item-${index}`,
packageName: `spark-item-${index}`,
displayName: `Spark Item ${index}`,
}),
),
tasks: [],
warnings: [],
hasRunningTasks: false,
});
const { container } = render(UpdateCenterModal, {
props: {
show: true,
store,
},
});
const scrollContainer = container.querySelector(".scrollbar-muted");
expect(scrollContainer?.className).toContain("overflow-y-auto");
expect(scrollContainer?.className).toContain("flex-1");
expect(scrollContainer?.className).toContain("overscroll-contain");
});
it("renders source tags, running state, warnings, and migration marker", () => {
const store = createStore();