Skip to content

Commit

Permalink
Add golden tests for ClientCapability(List)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcapriotti committed Jun 10, 2021
1 parent 469b0a1 commit 99da2f8
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 1 deletion.
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: c86173e7b15d84b4e33d4f6faa9f1445031dc2d669e52f7f49ccf9f74571beaf
-- hash: d07abc2b7ae7cc22a3d1cac4f0f07a8358301907c91bc72a0caf0a28f31ecfa0

name: wire-api
version: 0.1.0
Expand Down Expand Up @@ -383,6 +383,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

0 comments on commit 99da2f8

Please sign in to comment.