Skip to content

Commit

Permalink
fix rebase error duplicating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyThiessen committed Dec 19, 2024
1 parent 4bb7b22 commit 3232e31
Showing 1 changed file with 0 additions and 77 deletions.
77 changes: 0 additions & 77 deletions test/graphql/workflow_executions_query_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,81 +175,4 @@ def setup
assert_equal group_id, data['group']['id'], 'group id should match'
assert_nil data['project']
end

test 'workflow executions nodes query for samples should work' do
prelim_query = IridaSchema.execute(
WORKFLOW_EXECUTIONS_QUERY,
context: { current_user: @user },
variables: { first: 1 }
)['data']

workflow_execution_id = prelim_query['workflowExecutions']['nodes'][0]['id']
sample_id = prelim_query['workflowExecutions']['nodes'][0]['samples']['edges'][0]['node']['id']

result = IridaSchema.execute(WORKFLOW_EXECUTIONS_NODE_QUERY, context: { current_user: @user },
variables: { workflow_execution_id: })

data = result['data']['node']

assert_not_empty data['samplesWorkflowExecutions'], 'workflow execution samples resolver should work'
assert_equal sample_id, data['samplesWorkflowExecutions'][0]['sample']['id'], 'sample id should match'
end

test 'workflow executions nodes query for metadata though resolver should work' do
prelim_query = IridaSchema.execute(
WORKFLOW_EXECUTIONS_QUERY,
context: { current_user: @user },
variables: { first: 1 }
)['data']

workflow_execution_id = prelim_query['workflowExecutions']['nodes'][0]['id']

result = IridaSchema.execute(WORKFLOW_EXECUTIONS_NODE_QUERY, context: { current_user: @user },
variables: { workflow_execution_id: })

data = result['data']['node']

exp_metadata = { 'workflow_name' => 'wn1', 'workflow_version' => 'wv1' }
assert_equal exp_metadata, data['metadata']
end

test 'workflow executions nodes query for state should translate from enum' do
prelim_query = IridaSchema.execute(
WORKFLOW_EXECUTIONS_QUERY,
context: { current_user: @user },
variables: { first: 1 }
)['data']

workflow_execution_id = prelim_query['workflowExecutions']['nodes'][0]['id']

result = IridaSchema.execute(WORKFLOW_EXECUTIONS_NODE_QUERY, context: { current_user: @user },
variables: { workflow_execution_id: })

data = result['data']['node']

# We should have a string translated from the enum, not an integer
assert_equal 'initial', data['state']
end

test 'workflow executions nodes query should on groups' do
user = users(:james_doe)
prelim_query = IridaSchema.execute(
WORKFLOW_EXECUTIONS_QUERY,
context: { current_user: user },
variables: { first: 1 }
)['data']

workflow_execution_id = prelim_query['workflowExecutions']['nodes'][0]['id']

result = IridaSchema.execute(WORKFLOW_EXECUTIONS_NODE_QUERY, context: { current_user: user },
variables: { workflow_execution_id: })

assert_nil result['errors'], 'should work and have no errors.'

data = result['data']['node']
assert_not_empty data, 'workflow execution type should work'
group_id = groups(:group_one).to_global_id.to_s
assert_equal group_id, data['group']['id'], 'group id should match'
assert_nil data['project']
end
end

0 comments on commit 3232e31

Please sign in to comment.