@capillarytech/creatives-library 7.17.9 → 7.17.11
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.
package/.npmrc copy
ADDED
|
@@ -13,14 +13,14 @@ import React from 'react';
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
// import messages from './messages';
|
|
15
15
|
const loadScript = require('load-script');
|
|
16
|
-
const defaultScriptUrl = "https://storage.crm.n.content-cdn.io/
|
|
16
|
+
const defaultScriptUrl = "https://storage.crm.n.content-cdn.io/ckeditor_full/ckeditor/ckeditor.js";
|
|
17
17
|
const user = localStorage.getItem('user');
|
|
18
18
|
let locale = 'en';
|
|
19
19
|
if (user && JSON.parse(user).lang) {
|
|
20
20
|
locale = JSON.parse(user).lang;
|
|
21
21
|
}
|
|
22
22
|
const CKEditorConfig = {
|
|
23
|
-
skin: 'moono',
|
|
23
|
+
skin: 'moono-lisa',
|
|
24
24
|
toolbar: [
|
|
25
25
|
{ name: 'document', items: ['Source', '-'] },
|
|
26
26
|
{ name: 'clipboard', items: ['Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
|
package/package.json
CHANGED
|
@@ -13,14 +13,14 @@ import React from 'react';
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
// import messages from './messages';
|
|
15
15
|
const loadScript = require('load-script');
|
|
16
|
-
const defaultScriptUrl = "https://storage.crm.n.content-cdn.io/
|
|
16
|
+
const defaultScriptUrl = "https://storage.crm.n.content-cdn.io/ckeditor_full/ckeditor/ckeditor.js";
|
|
17
17
|
const user = localStorage.getItem('user');
|
|
18
18
|
let locale = 'en';
|
|
19
19
|
if (user && JSON.parse(user).lang) {
|
|
20
20
|
locale = JSON.parse(user).lang;
|
|
21
21
|
}
|
|
22
22
|
const CKEditorConfig = {
|
|
23
|
-
skin: 'moono',
|
|
23
|
+
skin: 'moono-lisa',
|
|
24
24
|
toolbar: [
|
|
25
25
|
{ name: 'document', items: ['Source', '-'] },
|
|
26
26
|
{ name: 'clipboard', items: ['Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import { injectIntl } from "react-intl";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { render, getByText, screen } from "../../../utils/test-utils";
|
|
5
|
+
import Ckeditor from "../index";
|
|
6
|
+
|
|
7
|
+
const initializeComponent = () => {
|
|
8
|
+
const Component = injectIntl(Ckeditor);
|
|
9
|
+
|
|
10
|
+
//const originalComponentDidMount = Ckeditor.prototype.componentDidMount;
|
|
11
|
+
Ckeditor.prototype.componentDidMount = jest.fn();
|
|
12
|
+
Ckeditor.prototype.handleContentChange = jest.fn();
|
|
13
|
+
|
|
14
|
+
//Render with default props.
|
|
15
|
+
return render(<Component />);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe("Load Ckeditor", () => {
|
|
19
|
+
it("Test if Ckeditor Mounts", () => {
|
|
20
|
+
initializeComponent();
|
|
21
|
+
|
|
22
|
+
expect(Ckeditor.prototype.componentDidMount).toHaveBeenCalled();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("Test if Ckeditor un-Mounts", () => {
|
|
26
|
+
// Spy on the componentWillUnmount method
|
|
27
|
+
const componentWillUnmountSpy = jest.spyOn(
|
|
28
|
+
Ckeditor.prototype,
|
|
29
|
+
"componentWillUnmount"
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
// Render the component
|
|
33
|
+
const { unmount } = initializeComponent();
|
|
34
|
+
|
|
35
|
+
// Manually unmount the component (simulate unmounting)
|
|
36
|
+
unmount();
|
|
37
|
+
|
|
38
|
+
// Assert that componentWillUnmount has been called
|
|
39
|
+
expect(componentWillUnmountSpy).toHaveBeenCalled();
|
|
40
|
+
|
|
41
|
+
// Clean up the spy
|
|
42
|
+
componentWillUnmountSpy.mockRestore();
|
|
43
|
+
});
|
|
44
|
+
});
|