Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
updated tests for new config key
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmarmour committed Sep 24, 2020
1 parent c980556 commit 03b5edd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ github.com/chromedp/chromedp v0.5.3 h1:F9LafxmYpsQhWQBdCs+6Sret1zzeeFyHS5LkRF//F
github.com/chromedp/chromedp v0.5.3/go.mod h1:YLdPtndaHQ4rCpSpBG+IPpy9JvX0VD+7aaLxYgYj28w=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dghubble/go-twitter v0.0.0-20200725221434-4bc8ad7ad1b4 h1:I60CX3+rWlBGPXR13jwxxBWB2GhlhZkEEh5o1eDLzJg=
github.com/dghubble/go-twitter v0.0.0-20200725221434-4bc8ad7ad1b4/go.mod h1:xfg4uS5LEzOj8PgZV7SQYRHbG7jPUnelEiaAVJxmhJE=
Expand Down Expand Up @@ -73,6 +74,7 @@ github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/webview/webview v0.0.0-20200724072439-e0c01595b361 h1:e0+/fQY5l9NdCwPsEg9S8AgE5lFhZ/6UX+b2KkpIBFg=
github.com/webview/webview v0.0.0-20200724072439-e0c01595b361/go.mod h1:rpXAuuHgyEJb6kXcXldlkOjU6y4x+YcASKKXJNUhh0Y=
Expand Down Expand Up @@ -114,4 +116,5 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
48 changes: 27 additions & 21 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ func TestGet(t *testing.T) {
telegram: false,
environment: func() {},
expected: &Config{
Locale: "en_us",
Currency: "USD",
Delay: 500,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
Locale: "en_us",
NvidiaLocale: "en-us",
Currency: "USD",
Delay: 500,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
},
},
"with sms": {
Expand All @@ -97,11 +98,12 @@ func TestGet(t *testing.T) {
telegram: false,
environment: envSMS(),
expected: &Config{
Locale: "en_us",
Currency: "USD",
Delay: 0,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
Locale: "en_us",
NvidiaLocale: "en-us",
Currency: "USD",
Delay: 0,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
TwilioConfig: TwilioConfig{
AccountSID: "1",
Token: "2",
Expand All @@ -118,11 +120,12 @@ func TestGet(t *testing.T) {
telegram: false,
environment: envDiscord(),
expected: &Config{
Locale: "en_us",
Currency: "USD",
Delay: 0,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
Locale: "en_us",
NvidiaLocale: "en-us",
Currency: "USD",
Delay: 0,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
DiscordConfig: DiscordConfig{
WebhookURL: "1",
},
Expand All @@ -136,11 +139,12 @@ func TestGet(t *testing.T) {
telegram: false,
environment: envTwitter(),
expected: &Config{
Locale: "en_us",
Currency: "USD",
Delay: 0,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
Locale: "en_us",
NvidiaLocale: "en-us",
Currency: "USD",
Delay: 0,
SKU: strPtr("5438481700"),
TestSKU: strPtr("5379432500"),
TwitterConfig: TwitterConfig{
ConsumerKey: "1",
ConsumerSecret: "2",
Expand All @@ -157,7 +161,9 @@ func TestGet(t *testing.T) {
telegram: true,
environment: envTelegram(),
expected: &Config{
Locale: "en_us",
Locale: "en_us",
NvidiaLocale: "en-us",

Currency: "USD",
Delay: 0,
SKU: strPtr("5438481700"),
Expand Down

0 comments on commit 03b5edd

Please sign in to comment.