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============================================
*/
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() }]
});
});
});
+
+ it('should test contains method to return false', ()=>{
+ directive.dropdownNotClosabledZone = false;
+ let el: HTMLElement;
+ expect(directive.contains(el)).toBe(false);
+ });
+
});