mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import * as tapClick from 'ionic/ionic';
|
|
|
|
export function run() {
|
|
|
|
describe("TapClick", () => {
|
|
|
|
describe("isActivatable", () => {
|
|
|
|
it('should be activatable on <a> element', () => {
|
|
let ele = document.createElement('a');
|
|
expect( tapClick.isActivatable(ele) ).toBe(true);
|
|
});
|
|
|
|
it('should be activatable on <button> element', () => {
|
|
let ele = document.createElement('button');
|
|
expect( tapClick.isActivatable(ele) ).toBe(true);
|
|
});
|
|
|
|
it('should be activatable on <ion-item-sliding> element', () => {
|
|
let ele = document.createElement('ion-item-sliding');
|
|
expect( tapClick.isActivatable(ele) ).toBe(false);
|
|
});
|
|
|
|
it('should be not activatable on <ion-item> element', () => {
|
|
let ele = document.createElement('ion-item');
|
|
expect( tapClick.isActivatable(ele) ).toBe(false);
|
|
});
|
|
|
|
it('should be not activatable on <div> element', () => {
|
|
let ele = document.createElement('div');
|
|
expect( tapClick.isActivatable(ele) ).toBe(false);
|
|
});
|
|
|
|
it('should be activatable with "tappable" attribute', () => {
|
|
let ele = document.createElement('div');
|
|
ele.setAttribute('tappable', true);
|
|
expect( tapClick.isActivatable(ele) ).toBe(true);
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|