Fix some tests
This commit is contained in:
@@ -14,7 +14,6 @@ func TestConfig_IsOwner(t *testing.T) {
|
|||||||
Info: struct {
|
Info: struct {
|
||||||
Name string `toml:"name"`
|
Name string `toml:"name"`
|
||||||
Icon string `toml:"icon"`
|
Icon string `toml:"icon"`
|
||||||
Secret string `toml:"secret"`
|
|
||||||
Pubkey string `toml:"pubkey"`
|
Pubkey string `toml:"pubkey"`
|
||||||
Description string `toml:"description"`
|
Description string `toml:"description"`
|
||||||
}{
|
}{
|
||||||
@@ -91,7 +90,6 @@ func TestConfig_CanManage(t *testing.T) {
|
|||||||
Info: struct {
|
Info: struct {
|
||||||
Name string `toml:"name"`
|
Name string `toml:"name"`
|
||||||
Icon string `toml:"icon"`
|
Icon string `toml:"icon"`
|
||||||
Secret string `toml:"secret"`
|
|
||||||
Pubkey string `toml:"pubkey"`
|
Pubkey string `toml:"pubkey"`
|
||||||
Description string `toml:"description"`
|
Description string `toml:"description"`
|
||||||
}{
|
}{
|
||||||
@@ -128,7 +126,6 @@ func TestConfig_CanInvite(t *testing.T) {
|
|||||||
Info: struct {
|
Info: struct {
|
||||||
Name string `toml:"name"`
|
Name string `toml:"name"`
|
||||||
Icon string `toml:"icon"`
|
Icon string `toml:"icon"`
|
||||||
Secret string `toml:"secret"`
|
|
||||||
Pubkey string `toml:"pubkey"`
|
Pubkey string `toml:"pubkey"`
|
||||||
Description string `toml:"description"`
|
Description string `toml:"description"`
|
||||||
}{
|
}{
|
||||||
@@ -164,7 +161,6 @@ func TestConfig_MemberRole(t *testing.T) {
|
|||||||
Info: struct {
|
Info: struct {
|
||||||
Name string `toml:"name"`
|
Name string `toml:"name"`
|
||||||
Icon string `toml:"icon"`
|
Icon string `toml:"icon"`
|
||||||
Secret string `toml:"secret"`
|
|
||||||
Pubkey string `toml:"pubkey"`
|
Pubkey string `toml:"pubkey"`
|
||||||
Description string `toml:"description"`
|
Description string `toml:"description"`
|
||||||
}{
|
}{
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ func createTestInstance() *Instance {
|
|||||||
Info: struct {
|
Info: struct {
|
||||||
Name string `toml:"name"`
|
Name string `toml:"name"`
|
||||||
Icon string `toml:"icon"`
|
Icon string `toml:"icon"`
|
||||||
Secret string `toml:"secret"`
|
|
||||||
Pubkey string `toml:"pubkey"`
|
Pubkey string `toml:"pubkey"`
|
||||||
Description string `toml:"description"`
|
Description string `toml:"description"`
|
||||||
}{
|
}{
|
||||||
@@ -156,8 +155,6 @@ func TestInstance_GenerateInviteEvent(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestInstance_IsInternalEvent(t *testing.T) {
|
func TestInstance_IsInternalEvent(t *testing.T) {
|
||||||
instance := createTestInstance()
|
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
event nostr.Event
|
event nostr.Event
|
||||||
@@ -207,7 +204,7 @@ func TestInstance_IsInternalEvent(t *testing.T) {
|
|||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
result := instance.IsInternalEvent(tt.event)
|
result := IsInternalEvent(tt.event)
|
||||||
if result != tt.want {
|
if result != tt.want {
|
||||||
t.Errorf("IsInternalEvent() = %v, want %v", result, tt.want)
|
t.Errorf("IsInternalEvent() = %v, want %v", result, tt.want)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ func TestManagementStore_BanEvent(t *testing.T) {
|
|||||||
bannedItems := mgmt.GetBannedEventItems()
|
bannedItems := mgmt.GetBannedEventItems()
|
||||||
itemFound := false
|
itemFound := false
|
||||||
for _, item := range bannedItems {
|
for _, item := range bannedItems {
|
||||||
if item.ID == eventID.Hex() && item.Reason == reason {
|
if item.ID == eventID && item.Reason == reason {
|
||||||
itemFound = true
|
itemFound = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user