Skip to content

Commit

Permalink
Add functions to PlatformMock to facilitate testing of Slides. closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
lathonez committed Feb 23, 2017
1 parent 764650b commit d7ee4d4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<a name="2.8.0"></a>
# 2.8.0 (2016-02-24)

### Features

* **Unit**: Add functions to PlatforMock to facilitate testing of Slides [#227](https://github.com/lathonez/clicker/issues/227) ([](https://github.com/lathonez/clicker/commit/))

<a name="2.7.0"></a>
# 2.7.0 (2017-01-26)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "ng test",
"test-coverage": "ng test --code-coverage"
},
"version": "2.7.0",
"version": "2.8.0",
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
Expand Down
25 changes: 25 additions & 0 deletions src/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ export class PlatformMock {
return document;
}

public is(): boolean {
return true;
}

public getElementComputedStyle(container: :any): any {
return {
paddingLeft: '10',
paddingTop: '10',
paddingRight: '10',
paddingBottom: '10'
}
}

public onResize(callback: any) {
return callback;
}

public registerListener(ele: any, eventName: string, callback: any): Function {
return (() => true);
}
Expand All @@ -79,6 +96,14 @@ export class PlatformMock {
public raf(callback: any): number {
return 1;
}

public timeout(callback: any, timer: number): any {
return setTimeout(callback, timer);
}

public cancelTimeout(id: any) {
// do nothing
}
}

export class MenuMock {
Expand Down

0 comments on commit d7ee4d4

Please sign in to comment.