From ab76cab5332de8baa2ca8b947b4a64d714b61f96 Mon Sep 17 00:00:00 2001 From: Romain Le Jeune Date: Tue, 17 Oct 2023 08:16:39 +0000 Subject: [PATCH] test: Update fake server with defautl draft content-type and test it. --- go.mod | 2 +- go.sum | 4 ++-- tests/contact_test.go | 4 ++-- tests/features/user/account.feature | 9 +++++++++ 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 tests/features/user/account.feature diff --git a/go.mod b/go.mod index e25e910b..d0fed8e9 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Masterminds/semver/v3 v3.2.0 github.com/ProtonMail/gluon v0.17.1-0.20231009084701-3af0474b0b3c github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a - github.com/ProtonMail/go-proton-api v0.4.1-0.20231011064807-aee19c63fa64 + github.com/ProtonMail/go-proton-api v0.4.1-0.20231016151024-8f03c5a977df github.com/ProtonMail/gopenpgp/v2 v2.7.3-proton github.com/PuerkitoBio/goquery v1.8.1 github.com/abiosoft/ishell v2.0.0+incompatible diff --git a/go.sum b/go.sum index 41934089..c8cc7f78 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/ProtonMail/go-message v0.13.1-0.20230526094639-b62c999c85b7 h1:+j+Kd/ github.com/ProtonMail/go-message v0.13.1-0.20230526094639-b62c999c85b7/go.mod h1:NBAn21zgCJ/52WLDyed18YvYFm5tEoeDauubFqLokM4= github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ekTTXpdwKYF8eBlsYsDVoggDAuAjoK66k= github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw= -github.com/ProtonMail/go-proton-api v0.4.1-0.20231011064807-aee19c63fa64 h1:w4OYy9IEbpMbl9wzWZ6TwAzAHfdqxjM3BgUA6ngRGM0= -github.com/ProtonMail/go-proton-api v0.4.1-0.20231011064807-aee19c63fa64/go.mod h1:ZmvQMA8hanLiD1tFsvu9+qGBcuxbIRfch/4z/nqBhXA= +github.com/ProtonMail/go-proton-api v0.4.1-0.20231016151024-8f03c5a977df h1:4UteX2UmmLe1xvn3HmdhLUjtwKuOMxzSa/tPsUvnX7s= +github.com/ProtonMail/go-proton-api v0.4.1-0.20231016151024-8f03c5a977df/go.mod h1:ZmvQMA8hanLiD1tFsvu9+qGBcuxbIRfch/4z/nqBhXA= github.com/ProtonMail/go-srp v0.0.7 h1:Sos3Qk+th4tQR64vsxGIxYpN3rdnG9Wf9K4ZloC1JrI= github.com/ProtonMail/go-srp v0.0.7/go.mod h1:giCp+7qRnMIcCvI6V6U3S1lDDXDQYx2ewJ6F/9wdlJk= github.com/ProtonMail/gopenpgp/v2 v2.7.3-proton h1:wuAxBUU9qF2wyDVJprn/2xPDx000eol5gwlKbOUYY88= diff --git a/tests/contact_test.go b/tests/contact_test.go index aeab60ae..a4cf33e5 100644 --- a/tests/contact_test.go +++ b/tests/contact_test.go @@ -362,8 +362,8 @@ func createContact(ctx context.Context, c *proton.Client, contact, name string, if err != nil { return err } - if res[0].Response.APIError.Code != proton.SuccessCode { - return errors.New("APIError " + res[0].Response.APIError.Message + " while creating contact") + if res[0].Response.Response.Code != proton.SuccessCode { + return errors.New("APIError " + res[0].Response.Response.Message + " while creating contact") } if settings != nil { diff --git a/tests/features/user/account.feature b/tests/features/user/account.feature new file mode 100644 index 00000000..21da4a6d --- /dev/null +++ b/tests/features/user/account.feature @@ -0,0 +1,9 @@ +Feature: Account settings + + Background: + Given there exists an account with username "[user:user]" and password "password" + Then it succeeds + When bridge starts + + Scenario: Check account default settings + the account "[user:user]" has default draft format "HTML" \ No newline at end of file