Skip to content

Commit a1bb684

Browse files
committed
issues #16 - removed unnecessary async - await, only the necessary ones remained
1 parent 1faf42a commit a1bb684

File tree

15 files changed

+318
-336
lines changed

15 files changed

+318
-336
lines changed

src/plugins/rangeSliderFox/mvc/controller/tests/controller.test.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ describe('------- Test Controller API -------', () => {
4444
wrapper.appendChild(input);
4545
});
4646

47-
const TEST_NAME1 = ' Check plugin events (onStart, onUpdate, onReset) '
48-
+ 'and API (update, reset)';
4947
// onStart, onUpdate, update, onReset, reset
50-
test(TEST_NAME1, () => {
48+
test(' Check plugin events (onStart, onUpdate, onReset) and API (update, reset)', () => {
5149
const controller = new Controller(new Model({
5250
onStart: (data: RangeSliderOptions) => {
5351
expect(data).toStrictEqual(defaultData);
@@ -169,11 +167,9 @@ describe('------- Test Controller API -------', () => {
169167
}), new View(input));
170168
});
171169

172-
const TEST_NAME2 = ' Check if plugin is configured in '
173-
+ 'line with data-attributes on its start ';
174170
// Data-Attributes static
175-
test(TEST_NAME2, async () => {
176-
await input.setAttribute('data-from', '5');
171+
test(' Check if plugin is configured in line with data-attributes on its start ', () => {
172+
input.setAttribute('data-from', '5');
177173
new Controller(new Model({
178174
onUpdate: (data: RangeSliderOptions) => {
179175
expect(data.from).toBe(5);
@@ -185,18 +181,18 @@ describe('------- Test Controller API -------', () => {
185181
const functionTest = jest.fn(() => {
186182
});
187183

188-
const controller = await new Controller(new Model({
184+
const controller = new Controller(new Model({
189185
onUpdate: functionTest,
190186
}), new View(input));
191187

192-
await controller.update({
188+
controller.update({
193189
from: 4,
194190
});
195191
await delay(100);
196-
await controller.destroy();
192+
controller.destroy();
197193

198194
await delay(100);
199-
await controller.update({
195+
controller.update({
200196
from: 8,
201197
});
202198

src/plugins/rangeSliderFox/mvc/model/Model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from './modelInterface';
2020
import ModelCalc from './ModelCalc';
2121

22-
interface insideOptions extends RangeSliderOptions {
22+
interface InsideOptions extends RangeSliderOptions {
2323
readonly fromX?: number,
2424
readonly toX?: number,
2525
readonly valuePercent?: number,
@@ -44,7 +44,7 @@ interface insideOptions extends RangeSliderOptions {
4444
readonly dot?: string,
4545
}
4646

47-
interface ObserverOptions extends insideOptions {
47+
interface ObserverOptions extends InsideOptions {
4848
key?: string,
4949
}
5050

src/plugins/rangeSliderFox/mvc/model/ModelData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface insideOptions extends RangeSliderOptions {
1313
}
1414

1515
interface ObserverOptions extends insideOptions {
16-
readonly key?: string,
16+
readonly key: string,
1717
}
1818

1919
class ModelData extends Observer<ObserverOptions> {

0 commit comments

Comments
 (0)