From 018d26f4a1a1cf411324aeac56ce4d4203670942 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 28 Aug 2020 14:18:37 +0200 Subject: [PATCH] fix: tests --- test/Database/Fill.hs | 7 +++++++ test/ModelSpec.hs | 7 +++++++ test/User.hs | 1 + 3 files changed, 15 insertions(+) diff --git a/test/Database/Fill.hs b/test/Database/Fill.hs index 1543441d8..4c1d4a3ee 100644 --- a/test/Database/Fill.hs +++ b/test/Database/Fill.hs @@ -118,6 +118,7 @@ fillDb = do , userNotificationSettings = def , userCreated = now , userLastLdapSynchronisation = Nothing + , userLdapPrimaryKey = Nothing , userCsvOptions = def { csvFormat = csvPreset # CsvPresetRFC } , userSex = Just SexMale , userShowSex = userDefaultShowSex @@ -146,6 +147,7 @@ fillDb = do , userNotificationSettings = def , userCreated = now , userLastLdapSynchronisation = Nothing + , userLdapPrimaryKey = Nothing , userCsvOptions = def { csvFormat = csvPreset # CsvPresetExcel } , userSex = Just SexMale , userShowSex = userDefaultShowSex @@ -174,6 +176,7 @@ fillDb = do , userNotificationSettings = def , userCreated = now , userLastLdapSynchronisation = Nothing + , userLdapPrimaryKey = Nothing , userSex = Just SexMale , userCsvOptions = def , userShowSex = userDefaultShowSex @@ -202,6 +205,7 @@ fillDb = do , userNotificationSettings = def , userCreated = now , userLastLdapSynchronisation = Nothing + , userLdapPrimaryKey = Nothing , userCsvOptions = def , userSex = Just SexMale , userShowSex = userDefaultShowSex @@ -230,6 +234,7 @@ fillDb = do , userNotificationSettings = def , userCreated = now , userLastLdapSynchronisation = Nothing + , userLdapPrimaryKey = Nothing , userCsvOptions = def , userSex = Just SexNotApplicable , userShowSex = userDefaultShowSex @@ -258,6 +263,7 @@ fillDb = do , userNotificationSettings = def , userCreated = now , userLastLdapSynchronisation = Nothing + , userLdapPrimaryKey = Nothing , userCsvOptions = def , userSex = Just SexFemale , userShowSex = userDefaultShowSex @@ -316,6 +322,7 @@ fillDb = do , userNotificationSettings = def , userCreated = now , userLastLdapSynchronisation = Nothing + , userLdapPrimaryKey = Nothing , userCsvOptions = def , userSex = Nothing , userShowSex = userDefaultShowSex diff --git a/test/ModelSpec.hs b/test/ModelSpec.hs index 2e103bf39..588c4a532 100644 --- a/test/ModelSpec.hs +++ b/test/ModelSpec.hs @@ -126,6 +126,13 @@ instance Arbitrary User where userCreated <- arbitrary userLastLdapSynchronisation <- arbitrary + userLdapPrimaryKey <- oneof + [ pure Nothing + , fmap Just $ pack <$> oneof + [ getPrintableString <$> arbitrary + , on (\l d -> l <> "@" <> d) getPrintableString <$> arbitrary <*> arbitrary + ] + ] return User{..} shrink = genericShrink diff --git a/test/User.hs b/test/User.hs index 919ca7019..35ba6a848 100644 --- a/test/User.hs +++ b/test/User.hs @@ -42,3 +42,4 @@ fakeUser adjUser = adjUser User{..} userNotificationSettings = def userCreated = unsafePerformIO getCurrentTime userLastLdapSynchronisation = Nothing + userLdapPrimaryKey = Nothing