-
Notifications
You must be signed in to change notification settings - Fork 159
fix(tooltip): mark tooltip as dirty when changing its role #17382
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: master
Are you sure you want to change the base?
Changes from all commits
5929899
b9ebeff
623d8a9
dd7e690
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 |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| import { DebugElement } from '@angular/core'; | ||
| import { DebugElement, ErrorHandler, provideZonelessChangeDetection } from '@angular/core'; | ||
| import { fakeAsync, TestBed, tick, flush, waitForAsync, ComponentFixture } from '@angular/core/testing'; | ||
| import { By } from '@angular/platform-browser'; | ||
| import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
| import { IgxTooltipSingleTargetComponent, IgxTooltipMultipleTargetsComponent, IgxTooltipPlainStringComponent, IgxTooltipWithToggleActionComponent, IgxTooltipWithCloseButtonComponent, IgxTooltipWithNestedContentComponent, IgxTooltipNestedTooltipsComponent } from '../../../../test-utils/tooltip-components.spec'; | ||
| import { UIInteractions } from '../../../../test-utils/ui-interactions.spec'; | ||
| import { UIInteractions, wait } from '../../../../test-utils/ui-interactions.spec'; | ||
|
mddragnev marked this conversation as resolved.
|
||
| import { HorizontalAlignment, VerticalAlignment, AutoPositionStrategy } from '../../../../core/src/services/public_api'; | ||
| import { IgxTooltipDirective } from './tooltip.directive'; | ||
| import { IgxTooltipTargetDirective } from './tooltip-target.directive'; | ||
|
|
@@ -1101,6 +1101,40 @@ describe('IgxTooltip', () => { | |
| expect(closeBtn).toBeTruthy(); | ||
| expect(tooltipNativeElement.getAttribute('role')).toBe('status'); | ||
| })); | ||
|
|
||
| describe('Zoneless', () => { | ||
| beforeEach(async () => { | ||
| TestBed.resetTestingModule(); | ||
| await TestBed.configureTestingModule({ | ||
| imports: [ | ||
| NoopAnimationsModule, | ||
| IgxTooltipWithCloseButtonComponent | ||
| ], | ||
| providers: [provideZonelessChangeDetection()] | ||
| }).compileComponents(); | ||
| }); | ||
|
|
||
| beforeEach(() => { | ||
| fix = TestBed.createComponent(IgxTooltipWithCloseButtonComponent); | ||
| fix.detectChanges(); | ||
| tooltipNativeElement = fix.debugElement.query(By.directive(IgxTooltipDirective)).nativeElement; | ||
| tooltipTarget = fix.componentInstance.tooltipTarget as IgxTooltipTargetDirective; | ||
| button = fix.debugElement.query(By.directive(IgxTooltipTargetDirective)); | ||
| }); | ||
|
|
||
| it('should not throw ExpressionChangedAfterItHasBeenChecked when showing sticky tooltip with close button', async () => { | ||
|
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. The current test correctly covers the original |
||
| const errorHandler = TestBed.inject(ErrorHandler); | ||
| const handleErrorSpy = spyOn(errorHandler, 'handleError'); | ||
|
|
||
| hoverElement(button); | ||
| await wait(SHOW_DELAY + 50); | ||
| fix.detectChanges(); | ||
|
|
||
| expect(handleErrorSpy).not.toHaveBeenCalled(); | ||
| verifyTooltipVisibility(tooltipNativeElement, tooltipTarget, true); | ||
| expect(tooltipNativeElement.getAttribute('role')).toBe('status'); | ||
| }); | ||
|
mddragnev marked this conversation as resolved.
|
||
| }); | ||
| }); | ||
|
|
||
| describe('IgxTooltip placement and offset', () => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.