-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(linter): fix files to limit line width to 120 chars
- Loading branch information
1 parent
f893f96
commit d7484b1
Showing
35 changed files
with
297 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,7 +132,8 @@ func (f *FbPost) add(t *testing.T, user, role string) { | |
} | ||
} | ||
`, | ||
Variables: map[string]interface{}{"text": f.Text, "id1": f.Author.Id, "id2": f.Sender.Id, "id3": f.Receiver.Id, "postCount": f.PostCount, "pwd": "password"}, | ||
Variables: map[string]interface{}{"text": f.Text, "id1": f.Author.Id, "id2": f.Sender.Id, | ||
"id3": f.Receiver.Id, "postCount": f.PostCount, "pwd": "password"}, | ||
} | ||
gqlResponse := getParams.ExecuteAsPost(t, common.GraphqlURL) | ||
common.RequireNoGQLErrors(t, gqlResponse) | ||
|
@@ -205,13 +206,19 @@ func TestAuth_DeleteOnInterfaceWithAuthRules(t *testing.T) { | |
|
||
for _, tcase := range testCases { | ||
// Fetch all the types implementing `Post` interface. | ||
allQuestions, allAnswers, allFbPosts, allPostsIds := getAllPosts(t, []string{"[email protected]", "[email protected]"}, []string{"ADMIN"}, []bool{true, false}) | ||
allQuestions, allAnswers, allFbPosts, allPostsIds := getAllPosts(t, | ||
[]string{"[email protected]", "[email protected]"}, []string{"ADMIN"}, []bool{true, false}) | ||
require.True(t, len(allQuestions) == 3) | ||
require.True(t, len(allAnswers) == 2) | ||
require.True(t, len(allFbPosts) == 2) | ||
require.True(t, len(allPostsIds) == 7) | ||
|
||
deleteQuestions, deleteAnswers, deleteFbPosts, _ := getAllPosts(t, []string{tcase.user}, []string{tcase.role}, []bool{tcase.ans}) | ||
deleteQuestions, deleteAnswers, deleteFbPosts, _ := getAllPosts( | ||
t, | ||
[]string{tcase.user}, | ||
[]string{tcase.role}, | ||
[]bool{tcase.ans}, | ||
) | ||
|
||
params := &common.GraphQLParams{ | ||
Headers: common.GetJWTForInterfaceAuth(t, tcase.user, tcase.role, tcase.ans, metaInfo), | ||
|
@@ -321,7 +328,8 @@ func TestAuth_DeleteOnTypeWithGraphTraversalAuthRuleOnInterface(t *testing.T) { | |
for _, tcase := range testCases { | ||
t.Run(tcase.user+strconv.FormatBool(tcase.ans), func(t *testing.T) { | ||
// Get all Question ids. | ||
_, allQuestionsIds := getAllQuestions(t, []string{"[email protected]", "[email protected]"}, []bool{true, false}) | ||
_, allQuestionsIds := getAllQuestions(t, | ||
[]string{"[email protected]", "[email protected]"}, []bool{true, false}) | ||
require.True(t, len(allQuestionsIds) == 3) | ||
deleteQuestions, _ := getAllQuestions(t, []string{tcase.user}, []bool{tcase.ans}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,9 @@ func getAllQuestions(t *testing.T, users []string, answers []bool) ([]*Question, | |
return questions, keys | ||
} | ||
|
||
func getAllPosts(t *testing.T, users []string, roles []string, answers []bool) ([]*Question, []*Answer, []*FbPost, []string) { | ||
func getAllPosts(t *testing.T, users []string, roles []string, answers []bool) ( | ||
[]*Question, []*Answer, []*FbPost, []string) { | ||
|
||
Questions, getAllQuestionIds := getAllQuestions(t, users, answers) | ||
Answers, getAllAnswerIds := getAllAnswers(t, users) | ||
FbPosts, getAllFbPostIds := getAllFbPosts(t, users, roles) | ||
|
@@ -428,7 +430,8 @@ func getAllLogs(t *testing.T, users, roles []string) ([]*Log, []string) { | |
} | ||
|
||
func TestAuth_UpdateOnInterfaceWithAuthRules(t *testing.T) { | ||
_, _, _, ids := getAllPosts(t, []string{"[email protected]", "[email protected]"}, []string{"ADMIN"}, []bool{true, false}) | ||
_, _, _, ids := getAllPosts(t, []string{"[email protected]", "[email protected]"}, | ||
[]string{"ADMIN"}, []bool{true, false}) | ||
testCases := []TestCase{{ | ||
name: "Only 2 nodes satisfy auth rules with the given values and hence should be updated", | ||
user: "[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.