Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hexaforce committed Jan 29, 2025
1 parent 6514131 commit 4a6be1b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 141 deletions.
35 changes: 0 additions & 35 deletions server/e2e/gql_layer_test.go

This file was deleted.

98 changes: 0 additions & 98 deletions server/e2e/gql_storytelling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,104 +409,6 @@ func duplicatePage(e *httpexpect.Expect, sID, storyID, pageID string) (GraphQLRe
return requestBody, res, pID.(string)
}

func addLayerToPage(e *httpexpect.Expect, sId, storyId, pageId, layerId string, swipeable *bool) (GraphQLRequest, *httpexpect.Value, string) {
requestBody := GraphQLRequest{
OperationName: "AddPageLayer",
Query: `mutation AddPageLayer($sceneId: ID!, $storyId: ID!, $pageId: ID!, $layerId: ID!, $swipeable: Boolean) {
addPageLayer( input: {sceneId: $sceneId, storyId: $storyId, pageId: $pageId, swipeable: $swipeable, layerId: $layerId} ) {
story {
id
pages{
id
}
}
page{
id
layers{
id
}
swipeableLayers{
id
}
}
}
}`,
Variables: map[string]any{
"sceneId": sId,
"storyId": storyId,
"pageId": pageId,
"layerId": layerId,
"swipeable": swipeable,
},
}

res := Request(e, uID.String(), requestBody)

pageRes := res.Object().
Value("data").Object().
Value("addPageLayer").Object().
Value("page").Object()

if swipeable != nil && *swipeable {
pageRes.Value("swipeableLayers").Array().
Path("$..id").Array().Contains(layerId)
} else {
pageRes.Value("layers").Array().
Path("$..id").Array().Contains(layerId)
}

return requestBody, res, layerId
}

func removeLayerToPage(e *httpexpect.Expect, sId, storyId, pageId, layerId string, swipeable *bool) (GraphQLRequest, *httpexpect.Value, string) {
requestBody := GraphQLRequest{
OperationName: "RemovePageLayer",
Query: `mutation RemovePageLayer($sceneId: ID!, $storyId: ID!, $pageId: ID!, $layerId: ID!, $swipeable: Boolean) {
removePageLayer( input: {sceneId: $sceneId, storyId: $storyId, pageId: $pageId, swipeable: $swipeable, layerId: $layerId} ) {
story {
id
pages{
id
}
}
page{
id
layers{
id
}
swipeableLayers{
id
}
}
}
}`,
Variables: map[string]any{
"sceneId": sId,
"storyId": storyId,
"pageId": pageId,
"layerId": layerId,
"swipeable": swipeable,
},
}

res := Request(e, uID.String(), requestBody)

pageRes := res.Object().
Value("data").Object().
Value("removePageLayer").Object().
Value("page").Object()

if swipeable != nil && *swipeable {
pageRes.Value("swipeableLayers").Array().
Path("$..id").Array().NotContains(layerId)
} else {
pageRes.Value("layers").Array().
Path("$..id").Array().NotContains(layerId)
}

return requestBody, res, layerId
}

func createBlock(e *httpexpect.Expect, sID, storyID, pageID, pluginId, extensionId string, idx *int) (GraphQLRequest, *httpexpect.Value, string) {
requestBody := GraphQLRequest{
OperationName: "CreateStoryBlock",
Expand Down
8 changes: 0 additions & 8 deletions server/internal/adapter/gql/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/reearth/reearthx/account/accountdomain/user"

"github.com/reearth/reearthx/account/accountusecase"
"github.com/samber/lo"
"golang.org/x/text/language"
)

Expand Down Expand Up @@ -61,10 +60,3 @@ func loaders(ctx context.Context) *Loaders {
func dataloaders(ctx context.Context) *DataLoaders {
return ctx.Value(contextDataloaders).(*DataLoaders)
}

func intToInt64(i *int) *int64 {
if i == nil {
return nil
}
return lo.ToPtr(int64(*i))
}

0 comments on commit 4a6be1b

Please sign in to comment.