Skip to content

Commit

Permalink
feat(ui): add tests summary in the dashboard (#2133)
Browse files Browse the repository at this point in the history
Co-authored-by: userquin <userquin@gmail.com>
  • Loading branch information
webfansplz and userquin committed Oct 14, 2022
1 parent 6ca1802 commit a6618c1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
22 changes: 11 additions & 11 deletions packages/ui/client/components/dashboard/DashboardEntry.cy.tsx
Expand Up @@ -5,20 +5,20 @@ const body = () => (<div data-testid="body-content">{ faker.lorem.words(2) }</di
const header = () => (<div data-testid="header-content">{ faker.hacker.phrase() }</div>)
const bodySelector = '[data-testid=body-content]'
const headerSelector = '[data-testid=header-content]'
const tailSelector = '[data-testid=tail]'
// const tailSelector = '[data-testid=tail]'

describe('DashboardEntry', () => {
it('tail is rendered by default', () => {
cy.mount(<DashboardEntry v-slots={{ body, header }}/>)
.get(tailSelector)
.should('exist')
})
// it('tail is rendered by default', () => {
// cy.mount(<DashboardEntry v-slots={{ body, header }}/>)
// .get(tailSelector)
// .should('exist')
// })

it('tail is not shown when true', () => {
cy.mount(<DashboardEntry tail v-slots={{ body, header }}/>)
.get(tailSelector)
.should('not.exist')
})
// it('tail is not shown when true', () => {
// cy.mount(<DashboardEntry tail v-slots={{ body, header }}/>)
// .get(tailSelector)
// .should('not.exist')
// })

it('renders the body and header slots', () => {
cy.mount(<DashboardEntry v-slots={{ body, header }}/>)
Expand Down
6 changes: 4 additions & 2 deletions packages/ui/client/components/dashboard/DashboardEntry.vue
Expand Up @@ -5,13 +5,15 @@ withDefaults(defineProps<{ tail?: boolean }>(), { tail: false })
<template>
<div p-2 text-center flex>
<div>
<div text-4xl>
<div text-4xl min-w-2em>
<slot name="body" />
</div>
<div text-md>
<slot name="header" />
</div>
</div>
<div v-if="!tail" data-testid="tail" my-2 op50 w-1px bg-current origin-center rotate-15 translate-x-3 />
<!--
<div v-if="!tail" data-testid="tail" my-0 op50 w-2px bg-current origin-center rotate-0 translate-x-3 />
-->
</div>
</template>
12 changes: 6 additions & 6 deletions packages/ui/client/components/dashboard/TestsFilesContainer.vue
@@ -1,10 +1,10 @@
<template>
<div gap-0 flex="~ col gap-4" h-full justify-center items-center>
<div bg-header rounded-lg p="y4 x2">
<!-- <section aria-labelledby="tests" m="y-4 x-2">
<TestsEntry />
</section> -->
<TestFilesEntry />
</div>
<!-- <div bg-header rounded-lg p="y4 x2"> -->
<section aria-labelledby="tests" m="y-4 x-2">
<TestsEntry />
</section>
<TestFilesEntry />
<!-- </div> -->
</div>
</template>

0 comments on commit a6618c1

Please sign in to comment.