|
@@ -178,7 +178,7 @@ describe('index-home/index.vue computeQuickApps:cart 常驻保障', function (
|
|
|
expect(body).toContain("result[i].locked !== 1")
|
|
expect(body).toContain("result[i].locked !== 1")
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- test('未满 6 格且无 cart:追加 cart 到末位', function () {
|
|
|
|
|
|
|
+ test('未满 4 格且无 cart:追加 cart 到末位', function () {
|
|
|
globalThis.__cartStubs['../../utils/app-library.js'] = {
|
|
globalThis.__cartStubs['../../utils/app-library.js'] = {
|
|
|
getShortcutableApps: function () {
|
|
getShortcutableApps: function () {
|
|
|
return appKeys().slice(0, 3).map(function (k) { return { key: k, name: k } })
|
|
return appKeys().slice(0, 3).map(function (k) { return { key: k, name: k } })
|
|
@@ -193,7 +193,7 @@ describe('index-home/index.vue computeQuickApps:cart 常驻保障', function (
|
|
|
expect(result[result.length - 1].appKey).toBe('cart')
|
|
expect(result[result.length - 1].appKey).toBe('cart')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- test('满 6 格且无 cart:替换最后一个非锁定项,cart 常驻且总数仍为 6', function () {
|
|
|
|
|
|
|
+ test('满 4 格且无 cart:替换最后一个非锁定项,cart 常驻且总数仍为 4', function () {
|
|
|
globalThis.__cartStubs['../../utils/app-library.js'] = {
|
|
globalThis.__cartStubs['../../utils/app-library.js'] = {
|
|
|
getShortcutableApps: function () {
|
|
getShortcutableApps: function () {
|
|
|
return appKeys().map(function (k) { return { key: k, name: k } })
|
|
return appKeys().map(function (k) { return { key: k, name: k } })
|
|
@@ -203,11 +203,11 @@ describe('index-home/index.vue computeQuickApps:cart 常驻保障', function (
|
|
|
return { appKey: k, locked: 0, sortOrder: i }
|
|
return { appKey: k, locked: 0, sortOrder: i }
|
|
|
})
|
|
})
|
|
|
const result = compute.call(vm, shortcuts, {})
|
|
const result = compute.call(vm, shortcuts, {})
|
|
|
- expect(result.length).toBe(6)
|
|
|
|
|
|
|
+ expect(result.length).toBe(4)
|
|
|
expect(result.some(function (x) { return x.appKey === 'cart' })).toBe(true)
|
|
expect(result.some(function (x) { return x.appKey === 'cart' })).toBe(true)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- test('6 个全锁定且无 cart:尊重用户锁定选择,不追加也不替换', function () {
|
|
|
|
|
|
|
+ test('4 个全锁定且无 cart:尊重用户锁定选择,不追加也不替换', function () {
|
|
|
globalThis.__cartStubs['../../utils/app-library.js'] = {
|
|
globalThis.__cartStubs['../../utils/app-library.js'] = {
|
|
|
getShortcutableApps: function () {
|
|
getShortcutableApps: function () {
|
|
|
return appKeys().map(function (k) { return { key: k, name: k } })
|
|
return appKeys().map(function (k) { return { key: k, name: k } })
|
|
@@ -217,7 +217,7 @@ describe('index-home/index.vue computeQuickApps:cart 常驻保障', function (
|
|
|
return { appKey: k, locked: 1, sortOrder: i }
|
|
return { appKey: k, locked: 1, sortOrder: i }
|
|
|
})
|
|
})
|
|
|
const result = compute.call(vm, shortcuts, {})
|
|
const result = compute.call(vm, shortcuts, {})
|
|
|
- expect(result.length).toBe(6)
|
|
|
|
|
|
|
+ expect(result.length).toBe(4)
|
|
|
expect(result.every(function (x) { return x.locked === 1 })).toBe(true)
|
|
expect(result.every(function (x) { return x.locked === 1 })).toBe(true)
|
|
|
expect(result.some(function (x) { return x.appKey === 'cart' })).toBe(false)
|
|
expect(result.some(function (x) { return x.appKey === 'cart' })).toBe(false)
|
|
|
})
|
|
})
|