@zeedhi/teknisa-components-common 1.94.1 → 1.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -436,6 +436,9 @@ class Image extends ComponentRender {
|
|
|
436
436
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
437
437
|
this.createAccessors();
|
|
438
438
|
}
|
|
439
|
+
load(event, element) {
|
|
440
|
+
this.callEvent('load', { event, element, component: this });
|
|
441
|
+
}
|
|
439
442
|
}
|
|
440
443
|
|
|
441
444
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/teknisa-components-common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.95.1",
|
|
4
4
|
"description": "Teknisa Components Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@zeedhi/core": "*"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "8cc8fee40dc2deabd88eaace030f0a344fc28c64"
|
|
36
36
|
}
|
|
@@ -43,4 +43,25 @@ describe('Image', () => {
|
|
|
43
43
|
expect(instance.fillHeight).toBeTruthy();
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
describe('load event', () => {
|
|
48
|
+
it('should call load event', () => {
|
|
49
|
+
const load = jest.fn();
|
|
50
|
+
const instance = new Image({
|
|
51
|
+
name: 'image',
|
|
52
|
+
component: 'TekImage',
|
|
53
|
+
events: {
|
|
54
|
+
load,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const event = {} as Event;
|
|
59
|
+
const element = {} as HTMLElement;
|
|
60
|
+
instance.load(event, element);
|
|
61
|
+
|
|
62
|
+
expect(load).toHaveBeenCalledWith({
|
|
63
|
+
event, element, component: instance,
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|
|
46
67
|
});
|