Feat v0.2.5 ui polish dead code (#9)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #9.
This commit is contained in:
@@ -12,13 +12,13 @@ func TestMatch(t *testing.T) {
|
||||
label, pattern string
|
||||
want bool
|
||||
}{
|
||||
{"chat.message.abc", "chat.message.abc", true},
|
||||
{"chat.message.abc", "chat.message.*", true},
|
||||
{"chat.message.abc", "chat.*", true},
|
||||
{"chat.message.abc", "*", true},
|
||||
{"chat.message.abc", "chat.message.xyz", false},
|
||||
{"chat.message.abc", "channel.message.*", false},
|
||||
{"chat.message.abc", "chat.message", false},
|
||||
{"workflow.assigned.abc", "workflow.assigned.abc", true},
|
||||
{"workflow.assigned.abc", "workflow.assigned.*", true},
|
||||
{"workflow.assigned.abc", "workflow.*", true},
|
||||
{"workflow.assigned.abc", "*", true},
|
||||
{"workflow.assigned.abc", "workflow.assigned.xyz", false},
|
||||
{"workflow.assigned.abc", "notification.new.*", false},
|
||||
{"workflow.assigned.abc", "workflow.assigned", false},
|
||||
{"ping", "ping", true},
|
||||
{"ping", "pong", false},
|
||||
{"plugin.hook.pre_completion", "plugin.hook.*", true},
|
||||
@@ -37,12 +37,12 @@ func TestBusPublishExact(t *testing.T) {
|
||||
bus := NewBus()
|
||||
var count int32
|
||||
|
||||
bus.Subscribe("chat.message.abc", func(e Event) {
|
||||
bus.Subscribe("workflow.assigned.abc", func(e Event) {
|
||||
atomic.AddInt32(&count, 1)
|
||||
})
|
||||
|
||||
bus.Publish(Event{Label: "chat.message.abc", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "chat.message.xyz", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "workflow.assigned.abc", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "workflow.assigned.xyz", Payload: json.RawMessage(`{}`)})
|
||||
|
||||
if atomic.LoadInt32(&count) != 1 {
|
||||
t.Errorf("expected 1 dispatch, got %d", count)
|
||||
@@ -53,13 +53,13 @@ func TestBusPublishWildcard(t *testing.T) {
|
||||
bus := NewBus()
|
||||
var count int32
|
||||
|
||||
bus.Subscribe("chat.message.*", func(e Event) {
|
||||
bus.Subscribe("workflow.assigned.*", func(e Event) {
|
||||
atomic.AddInt32(&count, 1)
|
||||
})
|
||||
|
||||
bus.Publish(Event{Label: "chat.message.abc", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "chat.message.xyz", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "chat.typing.abc", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "workflow.assigned.abc", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "workflow.assigned.xyz", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "workflow.claimed.abc", Payload: json.RawMessage(`{}`)})
|
||||
|
||||
if atomic.LoadInt32(&count) != 2 {
|
||||
t.Errorf("expected 2 dispatches, got %d", count)
|
||||
@@ -91,7 +91,7 @@ func TestBusGlobalWildcard(t *testing.T) {
|
||||
atomic.AddInt32(&count, 1)
|
||||
})
|
||||
|
||||
bus.Publish(Event{Label: "chat.message.abc", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "workflow.assigned.abc", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "system.notify", Payload: json.RawMessage(`{}`)})
|
||||
bus.Publish(Event{Label: "plugin.hook.pre_completion", Payload: json.RawMessage(`{}`)})
|
||||
|
||||
@@ -105,8 +105,6 @@ func TestRouteFor(t *testing.T) {
|
||||
label string
|
||||
want Direction
|
||||
}{
|
||||
{"chat.message.abc", DirLocal}, // chat routes removed in v0.1.0
|
||||
{"chat.typing.abc", DirLocal}, // chat routes removed in v0.1.0
|
||||
{"system.notify", DirToClient},
|
||||
{"plugin.hook.pre_completion", DirLocal},
|
||||
{"internal.db.write", DirLocal},
|
||||
|
||||
Reference in New Issue
Block a user