Skip to content

Commit

Permalink
Backend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edlouth committed Aug 21, 2023
1 parent b8390ee commit 787e8e1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions grai-server/app/api/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3170,6 +3170,39 @@ async def test_graph_filter_xy(test_context):
assert result.data["workspace"]["id"] == str(workspace.id)


@pytest.mark.django_db
async def test_graph_filter_inline_filters(test_context):
context, organisation, workspace, user, membership = test_context

query = """
query Workspace($workspaceId: ID!, $filter: JSON!) {
workspace(id: $workspaceId) {
id
graph(filters: {inline_filters: [$filter]}) {
id
}
}
}
"""

result = await schema.execute(
query,
variable_values={
"workspaceId": str(workspace.id),
"filter": {
"type": "table",
"field": "tag",
"operator": "contains",
"value": "test",
},
},
context_value=context,
)

assert result.errors is None
assert result.data["workspace"]["id"] == str(workspace.id)


@pytest.mark.django_db
async def test_graph_tables(test_context):
context, organisation, workspace, user, membership = test_context
Expand Down

0 comments on commit 787e8e1

Please sign in to comment.