Skip to content

Commit 98d2f5a

Browse files
committed
change visibility property to public
1 parent 06b4b04 commit 98d2f5a

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

projects/igniteui-angular/src/lib/toast/toast.component.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ describe('IgxToast', () => {
8585
toast.show();
8686

8787
expect(toast.isVisible).toBeTruthy();
88-
expect(toast._animationState).toBe('visible');
88+
expect(toast.animationState).toBe('visible');
8989
expect(toast.autoHide).toBeTruthy();
9090

9191
tick(1000);
9292
fixture.detectChanges();
9393
expect(toast.isVisible).toBeFalsy();
94-
expect(toast._animationState).toBe('invisible');
94+
expect(toast.animationState).toBe('invisible');
9595
}));
9696

9797
it('should not auto hide seconds after is open', fakeAsync(() => {
@@ -101,13 +101,13 @@ describe('IgxToast', () => {
101101
toast.show();
102102

103103
expect(toast.isVisible).toBeTruthy();
104-
expect(toast._animationState).toBe('visible');
104+
expect(toast.animationState).toBe('visible');
105105
expect(toast.autoHide).toBeFalsy();
106106

107107
tick(1000);
108108
fixture.detectChanges();
109109
expect(toast.isVisible).toBeTruthy();
110-
expect(toast._animationState).toBe('visible');
110+
expect(toast.animationState).toBe('visible');
111111
}));
112112

113113
it('visibility is properly toggled by its toggle() method.', (async() => {
@@ -117,13 +117,12 @@ describe('IgxToast', () => {
117117
spyOn(toast.onHidden, 'emit');
118118

119119
expect(toast.isVisible).toBe(true);
120-
// expect(toast._animationState).toBe('visible');
121120
toast.toggle();
122121
await wait();
123122
fixture.detectChanges();
124123

125124
expect(toast.isVisible).toBe(false);
126-
expect(toast._animationState).toBe('invisible');
125+
expect(toast.animationState).toBe('invisible');
127126
expect(toast.onShowing.emit).toHaveBeenCalledTimes(0);
128127
expect(toast.onShown.emit).toHaveBeenCalledTimes(0);
129128
expect(toast.onHiding.emit).toHaveBeenCalledTimes(1);
@@ -134,7 +133,7 @@ describe('IgxToast', () => {
134133
fixture.detectChanges();
135134

136135
expect(toast.isVisible).toBe(true);
137-
expect(toast._animationState).toBe('visible');
136+
expect(toast.animationState).toBe('visible');
138137
expect(toast.onShowing.emit).toHaveBeenCalledTimes(1);
139138
expect(toast.onShown.emit).toHaveBeenCalledTimes(1);
140139
expect(toast.onHiding.emit).toHaveBeenCalledTimes(1);
@@ -144,7 +143,7 @@ describe('IgxToast', () => {
144143
await wait();
145144
fixture.detectChanges();
146145
expect(toast.isVisible).toBe(false);
147-
expect(toast._animationState).toBe('invisible');
146+
expect(toast.animationState).toBe('invisible');
148147
}));
149148
});
150149
@Component({

projects/igniteui-angular/src/lib/toast/toast.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ let NEXT_ID = 0;
5252
})
5353
export class IgxToastComponent implements IToggleView, OnInit, OnDestroy {
5454
@HostBinding('@animate')
55-
private _animationState = 'invisible';
55+
public animationState = 'invisible';
5656
private _isVisible = false;
5757

5858
/**
@@ -248,7 +248,7 @@ export class IgxToastComponent implements IToggleView, OnInit, OnDestroy {
248248
clearInterval(this.timeoutId);
249249
this.onShowing.emit(this);
250250
this.isVisible = true;
251-
this._animationState = 'visible';
251+
this.animationState = 'visible';
252252

253253
if (this.autoHide) {
254254
this.timeoutId = setTimeout(() => {
@@ -270,7 +270,7 @@ export class IgxToastComponent implements IToggleView, OnInit, OnDestroy {
270270
this.onHiding.emit(this);
271271
this.isVisible = false;
272272
this.onHidden.emit(this);
273-
this._animationState = 'invisible';
273+
this.animationState = 'invisible';
274274

275275
clearInterval(this.timeoutId);
276276
}

0 commit comments

Comments
 (0)