Skip to content

Commit

Permalink
fix: bug with forum ignore being watch list too
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Jan 12, 2025
1 parent 182834f commit 8e5c655
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
18 changes: 18 additions & 0 deletions app/configurator/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,21 @@ func TestDoNotInputRepeatedTags(t *testing.T) {
})

}

func TestAddForumIgnore(t *testing.T) {
FixtureMigrator(func(dbname types.Dbpath) {
configur := FixtureConfigurator(dbname)
cg := NewConfiguratorForumIgnore(configur)

ConfiguratorChannel{Configurator: configur}.Add("c1")
cg.TagsAdd("c1", []types.Tag{"t1", "t2"}...)

tags, _ := cg.TagsList("c1")
assert.Len(t, tags, 2)

watch_cfg := NewConfiguratorForumWatch(configur)
watch_tags, _ := watch_cfg.TagsList("c1")
assert.Len(t, watch_tags, 0)
})

}
2 changes: 1 addition & 1 deletion app/consoler/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func CreateConsoler(
cmdgroup.Command("ignore"),
cmdgroup.ShortDesc("Ignore commands"),
),
configurator.NewConfiguratorForumWatch(configur),
configurator.NewConfiguratorForumIgnore(configur),
configurator.NewConfiguratorChannel(configur),
)

Expand Down
12 changes: 12 additions & 0 deletions app/consoler/consoler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ func TestSystemCommands(t *testing.T) {
assert.Contains(t, result, "System commands")
})
}

func TestAddForumIgnore(t *testing.T) {
configurator.FixtureMigrator(func(dbpath types.Dbpath) {
channelID, _ := configurator.FixtureChannel(dbpath)
response := NewConsoler(dbpath).Execute(settings.Env.ConsolerPrefix+` forum thread ignore add Soundtrack`, channelID)
response2 := NewConsoler(dbpath).Execute(settings.Env.ConsolerPrefix+` forum thread watch list`, channelID)

_ = response
_ = response2
// assert.Contains(t, )
})
}

0 comments on commit 8e5c655

Please sign in to comment.