Skip to content

Commit

Permalink
fix(testIcon): fix test verify class
Browse files Browse the repository at this point in the history
  • Loading branch information
mmohadIGN committed Jan 30, 2025
1 parent 4b0c191 commit 27f388e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions libs/ui/dataviz/src/lib/figure/figure.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
textClass
}} text-[1.875em] rounded-full mr-[0.55em] flex justify-center items-center w-[2.2em] h-[2.2em] shrink-0"
style="width: 2.2em; height: 2.2em"
data-test="icon-container"
>
<ng-icon class="text-[0.66em]" [name]="icon"> </ng-icon>
</div>
Expand Down
22 changes: 12 additions & 10 deletions libs/ui/dataviz/src/lib/figure/figure.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ describe('FigureComponent', () => {
expect(icon['name']).toContain('group')
})
it('icon is primary color', () => {
expect(compiled.querySelector('ng-icon')?.className).toContain(
'text-primary'
)
expect(
compiled.querySelector('[data-test=icon-container]')?.className
).toContain('text-primary')
})
it('icon background is primary color', () => {
expect(compiled.querySelector('ng-icon')?.className).toContain('bg-primary')
expect(
compiled.querySelector('[data-test=icon-container]')?.className
).toContain('bg-primary')
})
it('label is black text color', () => {
expect(compiled.querySelector('.figure-block')?.className).toContain(
Expand Down Expand Up @@ -95,14 +97,14 @@ describe('FigureComponent', () => {
fixture.detectChanges()
})
it('icon is secondary color', () => {
expect(compiled.querySelector('ng-icon')?.className).toContain(
'text-secondary'
)
expect(
compiled.querySelector('[data-test=icon-container]')?.className
).toContain('text-secondary')
})
it('icon background is secondary color', () => {
expect(compiled.querySelector('ng-icon')?.className).toContain(
'bg-secondary'
)
expect(
compiled.querySelector('[data-test=icon-container]')?.className
).toContain('bg-secondary')
})
})
})

0 comments on commit 27f388e

Please sign in to comment.