mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-05-30 01:31:06 +08:00
fix(update-center): handle missing apm and restore scrolling
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="min-h-0 flex-1">
|
||||
<div class="flex min-h-0 flex-1">
|
||||
<UpdateCenterList
|
||||
:items="store.filteredItems.value"
|
||||
:tasks="store.snapshot.value.tasks"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
class="min-h-0 overflow-y-auto overscroll-contain scrollbar-muted border-r border-slate-200/70 p-6 dark:border-slate-800/70"
|
||||
class="min-h-0 flex-1 overflow-y-auto overscroll-contain scrollbar-muted border-r border-slate-200/70 p-6 dark:border-slate-800/70"
|
||||
>
|
||||
<div
|
||||
v-if="items.length === 0"
|
||||
|
||||
Reference in New Issue
Block a user