Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev #5214

Merged
merged 56 commits into from
Jul 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7cf0e37
Add autoFormat option to CodeMirrorEditor
artf Jun 7, 2023
e8c3a02
Add optsCodeViewer
artf Jun 7, 2023
608b200
Remove unused options
artf Jun 7, 2023
a3f11b6
Use createViewer in ExportTemplate
artf Jun 7, 2023
534f269
Up ExportTemplate
artf Jun 7, 2023
7f38927
Cleanup
artf Jun 7, 2023
1749a58
Up panel/index to TS
artf Jun 14, 2023
48c1f06
Refactor Panels TS #5144
artf Jun 14, 2023
3cd1171
Cleanup
artf Jun 14, 2023
df45b8f
Up panels test
artf Jun 14, 2023
e3cacfd
Fix `usePlugin is not a function`. Closes #5167
artf Jun 14, 2023
ec5f13e
Move css_composer/index to TS
artf Jun 15, 2023
cf01983
Up css_composer tests
artf Jun 15, 2023
f94b06e
Up tests
artf Jun 15, 2023
763865d
Add `addStyles` option to `editor.Css.setRule`. Closes #5173
artf Jun 15, 2023
b334700
Update setRule JSDoc
artf Jun 15, 2023
6db8fe2
Fix PropertyStack in bundled dts file. Closes #5154
artf Jun 15, 2023
7fc33a7
Fixed broken link in README.md (#5188)
pfaffmann Jun 15, 2023
047dc35
Refactor Traits Collection (#4983)
xQwexx Jun 15, 2023
1fcf41c
Update keymaps add jsdoc
artf Jun 19, 2023
20d4a90
Improve typings (#5192)
Julia-Alberici Jun 19, 2023
1365ca1
Merge branch 'dev' of https://github.com/artf/grapesjs into dev
artf Jun 19, 2023
401a4f2
Use LiteralUnion in storage_manager config
artf Jun 19, 2023
4053acf
Up editor TS
artf Jun 19, 2023
21437f3
Improve components TS
artf Jun 19, 2023
4fa228d
Update ComponentModelDefinition
artf Jun 19, 2023
ca03f2c
[Docs] Update Broken Links for (Component Types, and Commands) (#5196)
AbdelrhmanSaid Jun 21, 2023
88339f6
Don't remove styles with avoidInlineStyle #4503
artf Jun 21, 2023
09fabe0
Up block_manager
artf Jun 27, 2023
7379330
Up device_manager
artf Jun 28, 2023
f56b875
Up pages TS
artf Jun 28, 2023
4f127c2
Add PageProperties
artf Jun 28, 2023
7f8567b
Update PageManager TS
artf Jun 28, 2023
8bec797
Export Sector/s in TS
artf Jun 30, 2023
2a6f50a
Up style_manager TS
artf Jun 30, 2023
69abad7
Up Property TS
artf Jun 30, 2023
75d10a0
Up TS
artf Jun 30, 2023
8f416b1
Up TS
artf Jul 1, 2023
e6ec9f1
Up canvas class
artf Jul 1, 2023
2dcc5b0
Fix SwitchVisibility
artf Jul 1, 2023
e5b04f9
Store custom selector manager container
artf Jul 3, 2023
819d0d6
Refactor OpenStyleManager
artf Jul 3, 2023
454d9c8
Up OpenStyleManager
artf Jul 3, 2023
c436290
Up OpenStyleManager
artf Jul 3, 2023
1be7957
Up selector_manager
artf Jul 3, 2023
ca6f2d1
Add custom option to trait_manager
artf Jul 3, 2023
a871f54
Up trait model
artf Jul 3, 2023
2f886a0
Up OpenTraitManager for custom traits
artf Jul 3, 2023
3a39dc9
Up
artf Jul 4, 2023
8d7af1c
Handle properly Component model `defaults` as functions. Closes #5199
artf Jul 4, 2023
f0ad0bc
Fix PropertyFactory tests
artf Jul 4, 2023
1cc3919
Up RTE doc
artf Jul 4, 2023
8e89d8a
Update rich_text_editor.md (#5201)
gxanshu Jul 4, 2023
f16638a
Merge branch 'dev' of https://github.com/artf/grapesjs into dev
artf Jul 4, 2023
4f81fb7
Build
artf Jul 4, 2023
8ddb937
Up docs
artf Jul 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Up panels test
  • Loading branch information
artf committed Jun 14, 2023
commit df45b8f894c8d7bc3a1867b00ae3c0c2ad89caf5
46 changes: 23 additions & 23 deletions test/specs/panels/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ describe('Panels', () => {
});

test('Adds new panel correctly via object', () => {
var panel = obj.addPanel({ id: 'test' });
const panel = obj.addPanel({ id: 'test' });
expect(panel.get('id')).toEqual('test');
});

test('New panel has no buttons', () => {
var panel = obj.addPanel({ id: 'test' });
const panel = obj.addPanel({ id: 'test' });
expect(panel.buttons.length).toEqual(0);
});

test('Adds new panel correctly via Panel instance', () => {
var oPanel = new Panel(obj, { id: 'test' });
var panel = obj.addPanel(oPanel);
const oPanel = new Panel(obj, { id: 'test' });
const panel = obj.addPanel(oPanel);
expect(panel).toEqual(oPanel);
expect(panel.get('id')).toEqual('test');
});
Expand All @@ -42,7 +42,7 @@ describe('Panels', () => {
});

test('getPanel returns correctly the panel', () => {
var panel = obj.addPanel({ id: 'test' });
const panel = obj.addPanel({ id: 'test' });
expect(obj.getPanel('test')).toEqual(panel);
});

Expand All @@ -51,8 +51,8 @@ describe('Panels', () => {
});

test('Add button correctly', () => {
var panel = obj.addPanel({ id: 'test' });
var btn = obj.addButton('test', { id: 'btn' });
const panel = obj.addPanel({ id: 'test' });
const btn = obj.addButton('test', { id: 'btn' });
expect(panel.buttons.length).toEqual(1);
expect(panel.buttons.at(0).get('id')).toEqual('btn');
});
Expand All @@ -62,13 +62,13 @@ describe('Panels', () => {
});

test('getButton returns null in case there is no requested button', () => {
var panel = obj.addPanel({ id: 'test' });
obj.addPanel({ id: 'test' });
expect(obj.getButton('test', 'btn')).toEqual(null);
});

test('getButton returns correctly the button', () => {
var panel = obj.addPanel({ id: 'test' });
var btn = obj.addButton('test', { id: 'btn' });
obj.addPanel({ id: 'test' });
const btn = obj.addButton('test', { id: 'btn' });
expect(obj.getButton('test', 'btn')).toEqual(btn);
});

Expand All @@ -79,17 +79,17 @@ describe('Panels', () => {
test('Active correctly activable buttons', () => {
const fn = jest.fn();
obj.addPanel({ id: 'test' });
const btn = obj.addButton('test', { id: 'btn', active: true })!;
btn.on('updateActive', fn);
const btn = obj.addButton('test', { id: 'btn', active: true });
btn?.on('updateActive', fn);
obj.active();
expect(fn).toBeCalledTimes(1);
});

test('Disable correctly buttons flagged as disabled', () => {
const fn = jest.fn();
obj.addPanel({ id: 'test' });
const btn = obj.addButton('test', { id: 'btn', disable: true })!;
btn.on('change:disable', fn);
const btn = obj.addButton('test', { id: 'btn', disable: true });
btn?.on('change:disable', fn);
obj.disableButtons();
expect(fn).toBeCalledTimes(1);
});
Expand All @@ -100,17 +100,17 @@ describe('Panels', () => {

describe('Removes button', () => {
test('Remove button correctly with object', () => {
var panel = obj.addPanel({ id: 'test' });
var btn = obj.addButton('test', { id: 'btn' });
const panel = obj.addPanel({ id: 'test' });
const btn = obj.addButton('test', { id: 'btn' });
expect(panel.buttons.length).toEqual(1);
expect(panel.buttons.at(0).get('id')).toEqual('btn');
expect(obj.removeButton('test', { id: 'btn' })).toEqual(btn);
expect(panel.buttons.length).toEqual(0);
});

test('Remove button correctly with sting', () => {
var panel = obj.addPanel({ id: 'test' });
var btn = obj.addButton('test', { id: 'btn' });
const panel = obj.addPanel({ id: 'test' });
const btn = obj.addButton('test', { id: 'btn' });
expect(panel.buttons.length).toEqual(1);
expect(panel.buttons.at(0).get('id')).toEqual('btn');
expect(obj.removeButton('test', 'btn')).toEqual(btn);
Expand All @@ -120,24 +120,24 @@ describe('Panels', () => {

describe('Removes Panel', () => {
test('Removes panel correctly via object', () => {
var panel = obj.addPanel({ id: 'test' });
const panel = obj.addPanel({ id: 'test' });
expect(panel.get('id')).toEqual('test');
obj.removePanel('test');
expect(panel.get('id')).toEqual('test');
});

test('Removes panel correctly via Panel instance', () => {
var oPanel = new Panel(obj, { id: 'test' });
var panel = obj.addPanel(oPanel);
const oPanel = new Panel(obj, { id: 'test' });
const panel = obj.addPanel(oPanel);
expect(panel).toEqual(oPanel);
expect(panel.get('id')).toEqual('test');
obj.removePanel(oPanel);
expect(obj.getPanels.length).toEqual(0);
});

test('Removes panel correctly via id', () => {
var oPanel = new Panel(obj, { id: 'test' });
var panel = obj.addPanel(oPanel);
const oPanel = new Panel(obj, { id: 'test' });
const panel = obj.addPanel(oPanel);
expect(panel).toEqual(oPanel);
expect(panel.get('id')).toEqual('test');
obj.removePanel('test');
Expand Down