Skip to content

Commit

Permalink
Fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abhitip committed Apr 22, 2020
1 parent 4ceaa7b commit 27d3ffb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Events/Authentication/__tests__/CreatedAccount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,46 @@ describe("createdAccount", () => {
contextModule: ContextModule.header,
intent: AuthIntent.signup,
service: "apple",
user_id: "foo",
})

expect(args).toEqual({
action: "createdAccount",
auth_redirect: "https://artsy.net/artist/andy-warhol",
context_module: "header",
modal_copy: undefined,
intent: "signup",
onboarding: false,
service: "apple",
trigger: "click",
type: "signup",
user_id: "foo",
})
})

it("Works with all args", () => {
const args = createdAccount({
authRedirect: "https://artsy.net/artist/andy-warhol",
contextModule: ContextModule.popUpModal,
copy: "Sign up to follow artists",
intent: AuthIntent.viewEditorial,
onboarding: true,
service: "email",
triggerSeconds: 2,
user_id: "foo",
})

expect(args).toEqual({
action: "createdAccount",
auth_redirect: "https://artsy.net/artist/andy-warhol",
context_module: "popUpModal",
modal_copy: "Sign up to follow artists",
intent: "viewEditorial",
onboarding: true,
service: "email",
trigger: "timed",
type: "signup",
user_id: "foo",
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,43 @@ describe("successfullyLoggedIn", () => {
contextModule: ContextModule.header,
intent: AuthIntent.signup,
service: "apple",
user_id: "foo",
})

expect(args).toEqual({
action: "successfullyLoggedIn",
auth_redirect: "https://artsy.net/artist/andy-warhol",
context_module: "header",
intent: "signup",
modal_copy: undefined,
service: "apple",
trigger: "click",
type: "login",
user_id: "foo",
})
})

it("Works with all args", () => {
const args = successfullyLoggedIn({
authRedirect: "https://artsy.net/artist/andy-warhol",
contextModule: ContextModule.popUpModal,
copy: "Sign up to follow artists",
intent: AuthIntent.viewEditorial,
service: "email",
triggerSeconds: 2,
user_id: "foo",
})

expect(args).toEqual({
action: "successfullyLoggedIn",
auth_redirect: "https://artsy.net/artist/andy-warhol",
context_module: "popUpModal",
intent: "viewEditorial",
modal_copy: "Sign up to follow artists",
service: "email",
trigger: "timed",
type: "login",
user_id: "foo",
})
})
})

0 comments on commit 27d3ffb

Please sign in to comment.