Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add golden tests for ClientCapability(List) #1590

Merged
merged 1 commit into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"capabilities": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"capabilities": [
"legalhold-implicit-consent"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"legalhold-implicit-consent"
10 changes: 10 additions & 0 deletions libs/wire-api/test/unit/Test/Wire/API/Golden/Manual.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ module Test.Wire.API.Golden.Manual where
import Imports
import Test.Tasty
import Test.Tasty.HUnit
import Test.Wire.API.Golden.Manual.ClientCapability
import Test.Wire.API.Golden.Manual.ClientCapabilityList
import Test.Wire.API.Golden.Manual.QualifiedUserClientPrekeyMap
import Test.Wire.API.Golden.Manual.UserClientPrekeyMap
import Test.Wire.API.Golden.Runner
Expand All @@ -43,5 +45,13 @@ tests =
testObjects
[ (testObject_QualifiedUserClientPrekeyMap_1, "testObject_QualifiedUserClientPrekeyMap_1.json"),
(testObject_QualifiedUserClientPrekeyMap_2, "testObject_QualifiedUserClientPrekeyMap_2.json")
],
testCase ("ClientCapability") $
testObjects
[(testObject_ClientCapability_1, "testObject_ClientCapability_1.json")],
testCase ("ClientCapabilityList") $
testObjects
[ (testObject_ClientCapabilityList_1, "testObject_ClientCapabilityList_1.json"),
(testObject_ClientCapabilityList_2, "testObject_ClientCapabilityList_2.json")
]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- This file is part of the Wire Server implementation.
--
-- Copyright (C) 2021 Wire Swiss GmbH <opensource@wire.com>
--
-- This program is free software: you can redistribute it and/or modify it under
-- the terms of the GNU Affero General Public License as published by the Free
-- Software Foundation, either version 3 of the License, or (at your option) any
-- later version.
--
-- This program is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
-- details.
--
-- You should have received a copy of the GNU Affero General Public License along
-- with this program. If not, see <https://www.gnu.org/licenses/>.

module Test.Wire.API.Golden.Manual.ClientCapability where

import Wire.API.User.Client (ClientCapability (..))

testObject_ClientCapability_1 :: ClientCapability
testObject_ClientCapability_1 = ClientSupportsLegalholdImplicitConsent
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- This file is part of the Wire Server implementation.
--
-- Copyright (C) 2021 Wire Swiss GmbH <opensource@wire.com>
--
-- This program is free software: you can redistribute it and/or modify it under
-- the terms of the GNU Affero General Public License as published by the Free
-- Software Foundation, either version 3 of the License, or (at your option) any
-- later version.
--
-- This program is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
-- details.
--
-- You should have received a copy of the GNU Affero General Public License along
-- with this program. If not, see <https://www.gnu.org/licenses/>.

module Test.Wire.API.Golden.Manual.ClientCapabilityList where

import qualified Data.Set as Set
import Imports
import Wire.API.User.Client (ClientCapability (..), ClientCapabilityList (..))

testObject_ClientCapabilityList_1 :: ClientCapabilityList
testObject_ClientCapabilityList_1 = ClientCapabilityList mempty

testObject_ClientCapabilityList_2 :: ClientCapabilityList
testObject_ClientCapabilityList_2 = ClientCapabilityList (Set.fromList [ClientSupportsLegalholdImplicitConsent])
4 changes: 3 additions & 1 deletion libs/wire-api/wire-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 58042dcdd8cad7b2456724f4cbaae1a856868fdfce42f729132e63cf21704a75
-- hash: 413899ff7cff9c419303a8ef3561f78f7bd719cc3e18f0b26f04a3cd4f31f358

name: wire-api
version: 0.1.0
Expand Down Expand Up @@ -387,6 +387,8 @@ test-suite wire-api-tests
Test.Wire.API.Golden.Generated.Wrapped_20_22some_5fint_22_20Int_user
Test.Wire.API.Golden.Generator
Test.Wire.API.Golden.Manual
Test.Wire.API.Golden.Manual.ClientCapability
Test.Wire.API.Golden.Manual.ClientCapabilityList
Test.Wire.API.Golden.Manual.QualifiedUserClientPrekeyMap
Test.Wire.API.Golden.Manual.UserClientPrekeyMap
Test.Wire.API.Golden.Runner
Expand Down