Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
feat(ui): test output dot
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Dec 21, 2021
1 parent b1ee17b commit 27b7c0f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/peeky-client/src/features/test/TestView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fragment testView on Test {
error {
...testResultError
}
hasLogs
}
${errorFragment}
`
Expand Down Expand Up @@ -147,7 +148,13 @@ mutation openInEditor ($id: ID!, $line: Int!, $col: Int!) {
<BaseTab
:to="{ name: 'test-output' }"
>
Output
<div class="flex items-center space-x-2">
<span>Output</span>
<div
v-if="test.hasLogs"
class="w-2 h-2 bg-primary-500 dark:bg-primary-400 rounded-full"
/>
</div>
</BaseTab>
</nav>

Expand Down
2 changes: 2 additions & 0 deletions packages/peeky-server/src/generated/nexus-typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export interface NexusGenFieldTypes {
duration: number | null; // Float
error: NexusGenRootTypes['TestError'] | null; // TestError
flag: NexusGenEnums['TestFlag'] | null; // TestFlag
hasLogs: boolean; // Boolean!
id: string; // ID!
logs: NexusGenRootTypes['TestLog'][]; // [TestLog!]!
slug: string; // String!
Expand Down Expand Up @@ -269,6 +270,7 @@ export interface NexusGenFieldTypeNames {
duration: 'Float'
error: 'TestError'
flag: 'TestFlag'
hasLogs: 'Boolean'
id: 'ID'
logs: 'TestLog'
slug: 'String'
Expand Down
1 change: 1 addition & 0 deletions packages/peeky-server/src/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type Test {
duration: Float
error: TestError
flag: TestFlag
hasLogs: Boolean!
id: ID!
logs: [TestLog!]!
slug: String!
Expand Down
3 changes: 3 additions & 0 deletions packages/peeky-server/src/schema/Test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export const Test = objectType({
t.nonNull.list.field('logs', {
type: nonNull(TestLog),
})
t.nonNull.boolean('hasLogs', {
resolve: test => !!test.logs.length,
})
},
})

Expand Down

0 comments on commit 27b7c0f

Please sign in to comment.