-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): geoJson/json import via integration api (#1231)
* imp * imp * wip: add e2e tests to geojson import * refactor e2e * fix geoJson handling * fix * fix lint * add i18n --------- Co-authored-by: nourbalaha <[email protected]> Co-authored-by: mimoham24 <[email protected]>
- Loading branch information
1 parent
7a89ce6
commit a694312
Showing
30 changed files
with
1,257 additions
and
290 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 |
---|---|---|
|
@@ -88,7 +88,7 @@ func baseSeederUser(ctx context.Context, r *repo.Container) error { | |
} | ||
|
||
func TestUpdateMe(t *testing.T) { | ||
e, _ := StartGQLServer(t, &app.Config{}, true, baseSeederUser) | ||
e := StartServer(t, &app.Config{}, true, baseSeederUser) | ||
query := `mutation { updateMe(input: {name: "updated",email:"[email protected]",lang: "ja",theme: DEFAULT,password: "Ajsownndww1",passwordConfirmation: "Ajsownndww1"}){ me{ id name email lang theme } }}` | ||
request := GraphQLRequest{ | ||
Query: query, | ||
|
@@ -109,9 +109,9 @@ func TestUpdateMe(t *testing.T) { | |
} | ||
|
||
func TestRemoveMyAuth(t *testing.T) { | ||
e, r := StartGQLServer(t, &app.Config{}, true, baseSeederUser) | ||
e, _, ar := StartServerWithRepos(t, &app.Config{}, true, baseSeederUser) | ||
|
||
u, err := r.User.FindByID(context.Background(), uId1) | ||
u, err := ar.User.FindByID(context.Background(), uId1) | ||
assert.Nil(t, err) | ||
assert.Equal(t, &user.Auth{Provider: "reearth", Sub: "reearth|" + uId1.String()}, u.Auths().GetByProvider("reearth")) | ||
|
||
|
@@ -129,15 +129,15 @@ func TestRemoveMyAuth(t *testing.T) { | |
WithHeader("X-Reearth-Debug-User", uId1.String()). | ||
WithBytes(jsonData).Expect().Status(http.StatusOK).JSON().Object() | ||
|
||
u, err = r.User.FindByID(context.Background(), uId1) | ||
u, err = ar.User.FindByID(context.Background(), uId1) | ||
assert.Nil(t, err) | ||
assert.Nil(t, u.Auths().Get("sub")) | ||
} | ||
|
||
func TestDeleteMe(t *testing.T) { | ||
e, r := StartGQLServer(t, &app.Config{}, true, baseSeederUser) | ||
e, _, ar := StartServerWithRepos(t, &app.Config{}, true, baseSeederUser) | ||
|
||
u, err := r.User.FindByID(context.Background(), uId1) | ||
u, err := ar.User.FindByID(context.Background(), uId1) | ||
assert.Nil(t, err) | ||
assert.NotNil(t, u) | ||
|
||
|
@@ -155,12 +155,12 @@ func TestDeleteMe(t *testing.T) { | |
WithHeader("X-Reearth-Debug-User", uId1.String()). | ||
WithBytes(jsonData).Expect().Status(http.StatusOK).JSON().Object() | ||
|
||
_, err = r.User.FindByID(context.Background(), uId1) | ||
_, err = ar.User.FindByID(context.Background(), uId1) | ||
assert.Equal(t, rerror.ErrNotFound, err) | ||
} | ||
|
||
func TestMe(t *testing.T) { | ||
e, _ := StartGQLServer(t, &app.Config{}, true, baseSeederUser) | ||
e := StartServer(t, &app.Config{}, true, baseSeederUser) | ||
query := ` { me{ id name email lang theme myWorkspaceId } }` | ||
request := GraphQLRequest{ | ||
Query: query, | ||
|
@@ -195,7 +195,7 @@ func TestMe(t *testing.T) { | |
} | ||
|
||
func TestSearchUser(t *testing.T) { | ||
e, _ := StartGQLServer(t, &app.Config{}, true, baseSeederUser) | ||
e := StartServer(t, &app.Config{}, true, baseSeederUser) | ||
query := fmt.Sprintf(` { searchUser(nameOrEmail: "%s"){ id name email } }`, "e2e") | ||
request := GraphQLRequest{ | ||
Query: query, | ||
|
@@ -230,7 +230,7 @@ func TestSearchUser(t *testing.T) { | |
} | ||
|
||
func TestNode(t *testing.T) { | ||
e, _ := StartGQLServer(t, &app.Config{}, true, baseSeederUser) | ||
e := StartServer(t, &app.Config{}, true, baseSeederUser) | ||
query := fmt.Sprintf(` { node(id: "%s", type: USER){ id } }`, uId1.String()) | ||
request := GraphQLRequest{ | ||
Query: query, | ||
|
@@ -248,7 +248,7 @@ func TestNode(t *testing.T) { | |
} | ||
|
||
func TestNodes(t *testing.T) { | ||
e, _ := StartGQLServer(t, &app.Config{}, true, baseSeederUser) | ||
e := StartServer(t, &app.Config{}, true, baseSeederUser) | ||
query := fmt.Sprintf(` { nodes(id: "%s", type: USER){ id } }`, uId1.String()) | ||
request := GraphQLRequest{ | ||
Query: query, | ||
|
Oops, something went wrong.