File tree Expand file tree Collapse file tree
src/routes/__test__/social Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ import app from "../../..";
22import request from "supertest" ;
33import { testFlags } from "../../../middleware/__test__/testSettings" ;
44
5+ // Authentication URL.
6+ let testCallbackUrl =
7+ "/social/authCallback?success=true&id=375612282&isVerified=false&firstname=Allistair&lastname=Vilakazi&username=375612282&email=&photo=http%3A%2F%2Fpbs.twimg.com%2Fprofile_images%2F378800000629602434%2Fc6e96888c20267d9eb13846b3f23d70d_normal.jpeg" ;
8+
59describe ( "Facebook authentication" , ( ) => {
610 beforeEach ( ( ) => {
711 testFlags . disableFacebook = false ;
@@ -18,6 +22,11 @@ describe("Facebook authentication", () => {
1822 ) ;
1923 } ) ;
2024
25+ it ( "should make a success callback after authentication" , async ( ) => {
26+ const res = await request ( app ) . get ( testCallbackUrl ) ;
27+ expect ( res . status ) . toBe ( 200 ) ;
28+ } ) ;
29+
2130 it ( "should return a 401 response" , async ( ) => {
2231 testFlags . disableFacebook = true ;
2332
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ import app from "../../..";
22import request from "supertest" ;
33import { testFlags } from "../../../middleware/__test__/testSettings" ;
44
5+ // Authentication URL.
6+ let testCallbackUrl =
7+ "/social/authCallback?success=true&id=45206423&isVerified=false&firstname=Allistair&lastname=Vilakazi&username=simply-alliv&email=&photo=https%3A%2F%2Favatars3.githubusercontent.com%2Fu%2F45206423%3Fv%3D4" ;
8+
59describe ( "GitHub authentication" , ( ) => {
610 beforeEach ( ( ) => {
711 testFlags . disableFacebook = false ;
@@ -18,6 +22,11 @@ describe("GitHub authentication", () => {
1822 ) ;
1923 } ) ;
2024
25+ it ( "should make a success callback after authentication" , async ( ) => {
26+ const res = await request ( app ) . get ( testCallbackUrl ) ;
27+ expect ( res . status ) . toBe ( 200 ) ;
28+ } ) ;
29+
2130 it ( "should return a 401 response" , async ( ) => {
2231 testFlags . disableGithub = true ;
2332
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ import app from "../../..";
22import request from "supertest" ;
33import { testFlags } from "../../../middleware/__test__/testSettings" ;
44
5+ // Authentication URL.
6+ let testCallbackUrl =
7+ "/social/authCallback?success=true&id=106257712146027420454&isVerified=true&firstname=Allistair&lastname=Vilakazi&username=allistair.vilakazi%40gmail.com&email=allistair.vilakazi%40gmail.com&photo=https%3A%2F%2Flh3.googleusercontent.com%2Fa-%2FAOh14GiygoCTW6KQa09vGR7zofMtGEE6YB9_ALO1EMxNMA#" ;
8+
59describe ( "Google authentication" , ( ) => {
610 beforeEach ( ( ) => {
711 testFlags . disableFacebook = false ;
@@ -18,6 +22,11 @@ describe("Google authentication", () => {
1822 ) ;
1923 } ) ;
2024
25+ it ( "should make a success callback after authentication" , async ( ) => {
26+ const res = await request ( app ) . get ( testCallbackUrl ) ;
27+ expect ( res . status ) . toBe ( 200 ) ;
28+ } ) ;
29+
2130 it ( "should return a 401 response" , async ( ) => {
2231 testFlags . disableGoogle = true ;
2332
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ import app from "../../..";
22import request from "supertest" ;
33import { testFlags } from "../../../middleware/__test__/testSettings" ;
44
5+ // Authentication URL.
6+ let testCallbackUrl =
7+ "/social/authCallback?success=true&id=4281211625282819&isVerified=false&firstname=Allistair&lastname=Vilakazi&username=allistair.vilakazi%40gmail.com&email=allistair.vilakazi%40gmail.com&photo=https%3A%2F%2Fplatform-lookaside.fbsbx.com%2Fplatform%2Fprofilepic%2F%3Fasid%3D4281211625282819%26height%3D200%26width%3D200%26ext%3D1599383493%26hash%3DAeRhrrwBsdhpY-gO#_=_" ;
8+
59describe ( "Twitter authentication" , ( ) => {
610 beforeEach ( ( ) => {
711 testFlags . disableFacebook = false ;
@@ -18,6 +22,11 @@ describe("Twitter authentication", () => {
1822 ) ;
1923 } ) ;
2024
25+ it ( "should make a success callback after authentication" , async ( ) => {
26+ const res = await request ( app ) . get ( testCallbackUrl ) ;
27+ expect ( res . status ) . toBe ( 200 ) ;
28+ } ) ;
29+
2130 it ( "should return a 401 response" , async ( ) => {
2231 testFlags . disableTwitter = true ;
2332
You can’t perform that action at this time.
0 commit comments