Skip to content

Commit

Permalink
add one more test and adjust doc
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlaverse committed Apr 19, 2024
1 parent 9323289 commit 23b77b7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "bitwarden_item_login" "example" {
# Use Bitwarden Resource
data "bitwarden_item_login" "example" {
search = "Example"
search = "Example"
}
```

Expand Down
2 changes: 1 addition & 1 deletion examples/quick/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ resource "bitwarden_item_login" "example" {

# Use Bitwarden Resource
data "bitwarden_item_login" "example" {
search = "Example"
search = "Example"
}
15 changes: 15 additions & 0 deletions internal/bitwarden/bw/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,18 @@ func TestCreateObjectEncoding(t *testing.T) {
assert.Equal(t, "create e30K", commandsExecuted()[1])
}
}

func TestListObjects(t *testing.T) {
removeMocks, commandsExecuted := test_command.MockCommands(t, map[string]string{
"list item --folderid folder-id --collectionid collection-id --search search": `[]`,
})
defer removeMocks(t)

b := NewClient("dummy")
_, err := b.ListObjects("item", WithFolderID("folder-id"), WithCollectionID("collection-id"), WithSearch("search"))

assert.NoError(t, err)
if assert.Len(t, commandsExecuted(), 1) {
assert.Equal(t, "list item --folderid folder-id --collectionid collection-id --search search", commandsExecuted()[0])
}
}

0 comments on commit 23b77b7

Please sign in to comment.