🔒 (notes): 新想法默认私有,设置里可改可见范围
公开和仅关注只对新想法生效。已有想法沿用原来记下的范围。
This commit is contained in:
1 parent
352ee1bd99
commit
338e2d2d3c
10 files changed
+207
-61
No files matched your search
@@ -58,9 +58,9 @@ local Setting = require("moonsource_weread.setting")
|
||||
local updates = 0
|
||||
local plugin = { desktop = { updateView = function() updates = updates + 1 end } }
|
||||
|
||||
-- 未登录:账号、合并本地阅读时长、显示段评、自定义分组代替分类四行。
|
||||
-- 未登录:账号、合并时长、段评、想法可见范围、自定义分组五行。
|
||||
local rows = Setting.rows(plugin)
|
||||
Assert.len(rows, 4)
|
||||
Assert.len(rows, 5)
|
||||
Assert.eq(rows[1]().status, "未登录 · 点此扫码")
|
||||
|
||||
-- 合并本地阅读时长默认关(云端优先);点按落盘开启并刷新设置页。
|
||||
@@ -82,23 +82,38 @@ reviews.callback()
|
||||
Assert.is_true(cfg.show_paragraph_reviews)
|
||||
Assert.is_true(rows[3]().status_on)
|
||||
|
||||
-- 想法默认可见:没设过是私有,点按在公开、仅关注、私有之间循环。
|
||||
local visibility = rows[4]()
|
||||
Assert.eq(visibility.title, "想法默认可见")
|
||||
Assert.eq(visibility.status, "私有")
|
||||
Assert.is_nil(cfg.note_visibility)
|
||||
visibility.callback()
|
||||
Assert.eq(cfg.note_visibility, "public")
|
||||
Assert.eq(rows[4]().status, "公开")
|
||||
rows[4]().callback()
|
||||
Assert.eq(cfg.note_visibility, "follow")
|
||||
Assert.eq(rows[4]().status, "仅关注")
|
||||
rows[4]().callback()
|
||||
Assert.eq(cfg.note_visibility, "private")
|
||||
Assert.eq(rows[4]().status, "私有")
|
||||
|
||||
-- 自定义分组代替分类默认开;点按关闭并清增量游标。
|
||||
local groups = rows[4]()
|
||||
local groups = rows[5]()
|
||||
Assert.eq(groups.title, "使用自定义分组代替分类")
|
||||
Assert.is_true(groups.status_on)
|
||||
cfg.shelf_cursor = { vid = "1", synckey = 9 }
|
||||
groups.callback()
|
||||
Assert.is_false(cfg.category_as_group)
|
||||
Assert.is_nil(cfg.shelf_cursor)
|
||||
Assert.is_false(rows[4]().status_on)
|
||||
Assert.is_false(rows[5]().status_on)
|
||||
|
||||
-- 已登录:追加续期与退出;退出先确认,确认后才清会话。
|
||||
logged_in = true
|
||||
rows = Setting.rows(plugin)
|
||||
Assert.len(rows, 6)
|
||||
Assert.len(rows, 7)
|
||||
Assert.eq(rows[1]().status, "tester")
|
||||
Assert.eq(rows[5]().title, "续期会话")
|
||||
local logout = rows[6]()
|
||||
Assert.eq(rows[6]().title, "续期会话")
|
||||
local logout = rows[7]()
|
||||
Assert.eq(logout.title, "退出登录")
|
||||
logout.callback()
|
||||
Assert.is_false(cleared, "未确认不退出")
|
||||
|
||||
Reference in new issue
Block a user