Skip to content

Commit

Permalink
chore: [capricorn86#1186] Adds support for Window.Touch
Browse files Browse the repository at this point in the history
  • Loading branch information
capricorn86 committed Jan 29, 2024
1 parent babeb13 commit 4b1af32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/happy-dom/src/event/ITouchInit.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import EventTarget from './EventTarget.js';
import IEventTarget from './IEventTarget.js';

export default interface ITouchInit {
identifier: number;
target: EventTarget;
target: IEventTarget;
clientX?: number;
clientY?: number;
screenX?: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/happy-dom/src/event/Touch.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import EventTarget from './EventTarget.js';
import IEventTarget from './IEventTarget.js';
import ITouchInit from './ITouchInit.js';

/**
*
*/
export default class Touch {
public readonly identifier: number;
public readonly target: EventTarget;
public readonly target: IEventTarget;
public readonly clientX: number;
public readonly clientY: number;
public readonly screenX: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/happy-dom/test/event/events/TouchEvent.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Touch from '../../../src/event/Touch.js';
import ITouchEventInit from '../../../src/event/events/ITouchEventInit.js';
import TouchEvent from '../../../src/event/events/TouchEvent.js';
import Window from '../../../src/window/Window.js';
import { describe, it, expect } from 'vitest';
import { HTMLElement } from '../../../src/index.js';

describe('TouchEvent', () => {
describe('constructor()', () => {
Expand All @@ -15,7 +15,7 @@ describe('TouchEvent', () => {
it('Initializes properties', () => {
const touch = new Touch({
identifier: 0,
target: new HTMLElement()
target: new Window().document.createElement('div')
});

const eventInit: ITouchEventInit = {
Expand Down

0 comments on commit 4b1af32

Please sign in to comment.