Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
passbyval committed Feb 19, 2021
1 parent 3e38b76 commit 8167ca8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/abstract-tester.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare type Diff = {
declare type IDiff = {
diffA: string;
diffB: string;
} | void;
Expand All @@ -7,9 +7,11 @@ export default abstract class AbstractTester {
constructor();
setPriorHtml(html: string): void;
current(): string;
next(): Promise<Diff>;
nextSync(): IDiff;
next(): Promise<IDiff>;
abstract fillIn(name: string, value: string): void;
abstract click(selector: Object | string): void;
protected abstract nextHtml(): Promise<string>;
protected abstract nextHtmlSync(): string;
}
export {};
9 changes: 9 additions & 0 deletions dist/abstract-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ var AbstractTester = /** @class */ (function () {
AbstractTester.prototype.current = function () {
return this.priorHtml;
};
AbstractTester.prototype.nextSync = function () {
var diffA = this.priorHtml;
var diffB = this.nextHtmlSync();
this.priorHtml = this.nextHtmlSync();
return {
diffA: diffA,
diffB: diffB
};
};
AbstractTester.prototype.next = function () {
return __awaiter(this, void 0, void 0, function () {
var diffA, diffB, _a;
Expand Down
4 changes: 3 additions & 1 deletion dist/vue-tester.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import AbstractTester from './abstract-tester';
interface VueWrapper {
html(): string;
find(selector: object | string): any;
find(selector: string | object): any;
findComponent(selector: string | object): any;
vm: {
$nextTick(): Promise<void>;
};
Expand All @@ -12,5 +13,6 @@ export default class VueTester extends AbstractTester {
fillIn(name: string, value: string): void;
click(selector: string | object): void;
protected nextHtml(): Promise<string>;
protected nextHtmlSync(): string;
}
export {};
6 changes: 5 additions & 1 deletion dist/vue-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ var VueTester = /** @class */ (function (_super) {
input.trigger('input');
};
VueTester.prototype.click = function (selector) {
this.wrapper.find(selector).trigger('click');
var findMethod = typeof selector === 'string' ? 'find' : 'findComponent';
this.wrapper[findMethod](selector).trigger('click');
};
VueTester.prototype.nextHtml = function () {
return __awaiter(this, void 0, void 0, function () {
Expand All @@ -81,6 +82,9 @@ var VueTester = /** @class */ (function (_super) {
});
});
};
VueTester.prototype.nextHtmlSync = function () {
return this.wrapper.html();
};
return VueTester;
}(abstract_tester_1.default));
exports.default = VueTester;

0 comments on commit 8167ca8

Please sign in to comment.