diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2018-08-06 16:49:52 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-08-06 17:45:58 +0000 |
commit | 57c8bf3c538bc757e37d0e86ff1fcdb9e1548f65 (patch) | |
tree | aa6fcc706eef2211308a6ac0c7db74ba3abd5834 /src/app/shared/directives/dropdownnotclosablezone.spec.ts | |
parent | cbf57b4546b9f6cd102cd5e6c73859706082dfea (diff) |
dropdownnotclosablezone directive :added test case
wrote test case to cover contains function of the directive
Issue-ID: APPC-1064
Change-Id: I510d121be6dff5c286a89db13bde5c9c46216e85
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src/app/shared/directives/dropdownnotclosablezone.spec.ts')
-rw-r--r-- | src/app/shared/directives/dropdownnotclosablezone.spec.ts | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/app/shared/directives/dropdownnotclosablezone.spec.ts b/src/app/shared/directives/dropdownnotclosablezone.spec.ts index e397f83..104b18a 100644 --- a/src/app/shared/directives/dropdownnotclosablezone.spec.ts +++ b/src/app/shared/directives/dropdownnotclosablezone.spec.ts @@ -16,8 +16,6 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -ECOMP is a trademark and service mark of AT&T Intellectual Property. ============LICENSE_END============================================ */ @@ -25,12 +23,16 @@ import { TestBed } from '@angular/core/testing'; import { DropdownNotClosableZone } from './dropdownnotclosablezone'; import { ElementRef } from '@angular/core'; +class MockElementRef implements ElementRef { + nativeElement = {}; + } describe('DropdownNotClosableZone', () => { let directive; beforeEach(() => { TestBed.configureTestingModule({ - declarations: [DropdownNotClosableZone] + declarations: [DropdownNotClosableZone], + providers: [{ provide: ElementRef, useClass: new MockElementRef() }] }); }); @@ -49,4 +51,11 @@ describe('DropdownNotClosableZone', () => { }); + + it('should test contains method to return false', ()=>{ + directive.dropdownNotClosabledZone = false; + let el: HTMLElement; + expect(directive.contains(el)).toBe(false); + }); + }); |