Skip to content

Commit

Permalink
feat(tests): add tests about org invite and ciphers collections
Browse files Browse the repository at this point in the history
  • Loading branch information
Lowaiz committed Aug 14, 2024
1 parent 64b662f commit 3065f51
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vaultwarden/models/bitwarden.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ def invite(
"emails": [email],
"accessAll": access_all,
"type": user_type,
"Collections": collections_payload,
"Groups": [],
"collections": collections_payload,
"groups": [],
}
resp = self.api_client.api_request(
"POST", f"api/organizations/{self.Id}/users/invite", json=payload
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

if [[ -z "${VAULTWARDEN_VERSION}" ]]; then
VAULTWARDEN_VERSION="1.30.5"
VAULTWARDEN_VERSION="1.32.0"
fi

temp_dir=$(mktemp -d)
Expand Down
19 changes: 19 additions & 0 deletions tests/e2e/test_bitwarden.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,25 @@ def test_add_remove_collection_from_user(self):
1,
)

def test_invite_user_than_remove(self):
resp = self.organization.invite("test-user-3@example.com")
self.assertTrue(resp.is_success)
user = self.organization.user_search(
"test-user-3@example.com", force_refresh=True
)
self.assertIsNotNone(user)
user.delete()

def test_add_remove_collection_cipher(self):
cipher = self.test_org_ciphers[0]
old_colls = cipher.CollectionIds
collection_1 = self.test_colls_ids[0]
cipher.add_collections(collections=[collection_1.Id])
res = self.organization.ciphers(force_refresh=True)
self.assertEqual(len(res), 1)
self.assertEqual(len(res[0].CollectionIds), 2)
cipher.update_collection(old_colls)

def test_deduplicate(self):
# Todo build test fixtures and delete them at the end of the test
return
Expand Down

0 comments on commit 3065f51

Please sign in to comment.