mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
test(notification): complete platform values and read watch output as NDJSON
A table test covers the completions of alias, config, auth and notification commands, including notification IDs from the inbox. The integration test reads tea notification watch --json as one object per line, and notification feedback, watch lines and completions name a subject the same way. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
3 files changed
+45
-11
No files matched your search
@@ -293,8 +293,9 @@ func TestGiteaMetadataLifecycle(t *testing.T) {
|
||||
require.False(t, notification.Pinned)
|
||||
require.NoError(t, json.Unmarshal(scoped("notification", "mark-unread", notificationID), ¬ification))
|
||||
require.True(t, notification.Unread)
|
||||
require.NoError(t, json.Unmarshal(scoped("notification", "watch", "--timeout", "500ms", "--interval", "100ms"), ¬ifications))
|
||||
require.NotEmpty(t, notifications)
|
||||
watched := json.NewDecoder(bytes.NewReader(scoped("notification", "watch", "--timeout", "500ms", "--interval", "100ms")))
|
||||
require.NoError(t, watched.Decode(¬ification), "watch prints one object per line")
|
||||
require.Equal(t, repo.FullName, notification.Repository)
|
||||
scoped("notification", "mark-read", "--all")
|
||||
require.Equal(t, "[]\n", string(scoped("notification", "list")))
|
||||
var release services.Release
|
||||
|
||||
Reference in new issue
Block a user