Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: IATR-M0 Page Header (#24722) #25360

Merged
merged 4 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/app/src/debug/DebugFailedTest.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('<DebugFailedTest/>', () => {
cy.percySnapshot()
})

it('tests responsvie UI', { viewportWidth: 700 }, () => {
it('tests responsive UI', { viewportWidth: 700 }, () => {
const testResult: TestResults = {
id: '676df87874',
titleParts: ['Test content', 'Test content 2', 'Test content 3', 'Test content 4', 'onMount() should be called once', 'hook() should be called twice and then'],
Expand All @@ -197,6 +197,9 @@ describe('<DebugFailedTest/>', () => {

assertRowContents(testResult)

cy.contains('...').realHover()
cy.contains('[data-cy=tooltip-content]', 'Test content 2').should('be.visible')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should contain everything that was hidden by the ellipsis separated by >

Suggested change
cy.contains('[data-cy=tooltip-content]', 'Test content 2').should('be.visible')
cy.contains('[data-cy=tooltip-content]', 'Test content 2 > Test content 3 > Test content 4').should('be.visible')


cy.percySnapshot()
})
})
15 changes: 14 additions & 1 deletion packages/app/src/debug/DebugFailedTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@
titlePart.type === 'LAST-1' ? 'shrink-0 whitespace-pre' :
titlePart.type === 'LAST-0' ? 'pl-2.5 truncate' : 'px-2.5 truncate'"
>
{{ titlePart.title }}
<template v-if="titlePart.title === '...'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<template v-if="titlePart.title === '...'">
<template v-if="titlePart.type === 'ELLIPSIS'">

Check with type instead of title

<Tooltip>
<span>...</span>
<template #popper>
<span data-cy="tooltip-content">{{ titlePart.originalTitle }}</span>
</template>
</Tooltip>
</template>
<template v-else>
{{ titlePart.title }}
</template>
</span>
</template>
<div
Expand Down Expand Up @@ -69,6 +79,7 @@ import GroupedDebugFailedTestVue from './GroupedDebugFailedTest.vue'
import { computed } from 'vue'
import type { TestResults } from './DebugSpec.vue'
import type { StatsMetadata_GroupsFragment } from '../generated/graphql'
import Tooltip from '@packages/frontend-shared/src/components/Tooltip.vue'

const props = defineProps<{
failedTestsResult: TestResults[]
Expand All @@ -84,6 +95,7 @@ const failedTestData = computed(() => {
type MappedTitlePart = {
title: string
type: Parts
originalTitle?: string
}
let isFirstMiddleAdded: boolean = false
const mappedTitleParts: MappedTitlePart[] = titleParts.map<MappedTitlePart | MappedTitlePart[]>((ele, index, parts) => {
Expand Down Expand Up @@ -121,6 +133,7 @@ const failedTestData = computed(() => {
{
title: '...',
type: 'ELLIPSIS',
originalTitle: ele,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to gather up all the "MIDDLE" parts to construct the originalTitle passed to the ELLIPSIS tooltip

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, thanks! I think I was missing the underlying concept here, that it's really combining the parts 👍

},
{
title: ele,
Expand Down