-
-
Notifications
You must be signed in to change notification settings - Fork 345
fix(ui): enlarge chart skeleton title block #2108
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { mountSuspended } from '@nuxt/test-utils/runtime' | ||
| import FacetBarChart from '~/components/Compare/FacetBarChart.vue' | ||
|
|
||
| describe('FacetBarChart', () => { | ||
| it('renders a taller loading skeleton with title and subtitle placeholders', async () => { | ||
| const component = await mountSuspended(FacetBarChart, { | ||
| props: { | ||
| values: [null, null], | ||
| packages: ['react', 'vue'], | ||
| label: 'Bundle size', | ||
| description: 'Compare install footprint', | ||
| facetLoading: true, | ||
| }, | ||
| }) | ||
|
|
||
| const skeleton = component.find('[data-test="facet-bar-chart-skeleton"]') | ||
| expect(skeleton.exists()).toBe(true) | ||
|
|
||
| const lines = skeleton.findAllComponents({ name: 'SkeletonInline' }) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checks for individual heights of placeholder items is not very useful. if we changed the height of the title to 8px for example, we'd have to update all of the unit tests for this. let's instead focus on the input instead and making sure that it exists. (eg: |
||
| expect(lines).toHaveLength(4) | ||
| expect(lines[0]?.attributes('class')).toContain('h-5') | ||
| expect(lines[1]?.attributes('class')).toContain('h-4') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a blocker for this PR, but this spec file could benefit from more comprehensive unit tests. success state, empty state, testing dynamic updates like the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is indeed not really in the scope of this issue, but can be part of an iteration pertaining to test coverage improvements. |
||
| expect(lines[2]?.attributes('class')).toContain('h-8') | ||
| expect(lines[3]?.attributes('class')).toContain('h-8') | ||
| }) | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're repeating the same element twice. could we extract this into its own separate component and reuse in multiple places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeating just twice, especially when only localised to this file only, is ok.