Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmmbaga committed Jan 15, 2024
1 parent 5882122 commit 7009743
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion management/server/posture/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestNBVersionCheck_Check(t *testing.T) {
wantErr: false,
},
{
name: "Valid Peer NB version With No Patch Version",
name: "Valid Peer NB version With No Patch Version 1",
input: peer.Peer{
Meta: peer.PeerSystemMeta{
UIVersion: "2.0.9",
Expand All @@ -41,6 +41,19 @@ func TestNBVersionCheck_Check(t *testing.T) {
},
wantErr: false,
},
{
name: "Valid Peer NB version With No Patch Version 2",
input: peer.Peer{
Meta: peer.PeerSystemMeta{
UIVersion: "2.0.0",
},
},
check: NBVersionCheck{
Enabled: true,
MinVersion: "2.0",
},
wantErr: false,
},
{
name: "Older Peer NB version",
input: peer.Peer{
Expand All @@ -54,6 +67,19 @@ func TestNBVersionCheck_Check(t *testing.T) {
},
wantErr: true,
},
{
name: "Older Peer NB version With Patch Version",
input: peer.Peer{
Meta: peer.PeerSystemMeta{
UIVersion: "0.1.0",
},
},
check: NBVersionCheck{
Enabled: true,
MinVersion: "0.2",
},
wantErr: true,
},
{
name: "Older Peer NB version With Check Disabled",
input: peer.Peer{
Expand Down

0 comments on commit 7009743

Please sign in to comment.