Skip to content

Commit 5f9a817

Browse files
committed
icon updated and testing added
1 parent f559cc0 commit 5f9a817

File tree

5 files changed

+57
-26
lines changed

5 files changed

+57
-26
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,5 @@ Allison Pratt @allisons11
166166
Joju Olaode @JojuOlaode
167167
```
168168
Inspired by [PreVue](https://github.com/open-source-labs/PreVue)
169+
169170
[↥Back to top](#table-of-contents)

src-electron/icons/icon.ico

-90.9 KB
Binary file not shown.
18.9 KB
Loading
13.7 KB
Loading

test/jest/__tests__/htmlElements.spec.js

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ import { mount, createLocalVue, shallowMount } from "@vue/test-utils";
99
import * as All from "quasar";
1010
const { Quasar, date } = All;
1111

12+
/**
13+
* @description: Testing functionality of HTML element mutations and actions
14+
* `actions:` `addNestedHtml', `AddNestedNoActive`, `setActiveHTML`, `setActiveLayer`,
15+
* `upOneLayer`, `deleteFromComponentHtmlList`, `deleteSelectedElement`
16+
* `mutations: SET_ACTIVE_LAYER, UP_ONE_LAYER, ADD_TO_SELECTED_ELEMENT_LIST, SET_SELECTED_ELEMENT_LIST,
17+
* ADD_TO_COMPONENT_HTML_LIST, ADD_NESTED_HTML, ADD_NESTED_NO_ACTIVE, DELETE_FROM_COMPONENT_HTML_LIST,
18+
* DELETE_SELECTED_ELEMENT, SET_ACTIVE_HTML_ELEMENT
19+
*/
20+
21+
1222
let hardA = {
1323
componentName: "a",
14-
x: 0,
15-
y: 20,
16-
z: 0,
17-
w: 200,
18-
h: 200,
1924
htmlList: [{
2025
children:[{
2126
children:[{
@@ -54,8 +59,6 @@ const newState = {
5459
NewView: []
5560
},
5661
componentNameInputValue: '',
57-
projects: [{ filename: 'Untitled-1', lastSavedLocation: '' }],
58-
5962
activeRoute: 'HomeView',
6063
activeComponent: '',
6164
activeHTML: '',
@@ -65,14 +68,6 @@ const newState = {
6568
},
6669

6770
selectedElementList: [],
68-
projectNumber: 2,
69-
activeTab: 0,
70-
componentChildrenMultiselectValue: [],
71-
modalOpen: false,
72-
parentSelected: false,
73-
imagePath: {
74-
HomeView: ''
75-
}
7671
}
7772

7873
describe("Tests for navigating layers in HTML elements", () => {
@@ -226,20 +221,55 @@ describe("tests for HTML element actions", () => {
226221
expect(commit).toHaveBeenCalledWith("ADD_NESTED_HTML", element);
227222
});
228223

224+
test('"[types.addNestedNoActive]" action calls the "ADD_NESTED_NO_ACTIVE" mutation', () => {
225+
const element = {
226+
date: Date.now(),
227+
elementName: "div"
228+
};
229+
const commit = jest.fn();
230+
actions[types.addNestedNoActive]({ commit }, element);
231+
expect(commit).toHaveBeenCalledWith("ADD_NESTED_NO_ACTIVE", element);
232+
});
233+
234+
test('"[types.setActiveHTML]" action calls the "SET_ACTIVE_HTML mutation', () => {
235+
const element = [ 'div', 0, Date.now() ];
236+
const commit = jest.fn();
237+
actions[types.setActiveHTML]({ commit }, element);
238+
expect(commit).toHaveBeenCalledWith("SET_ACTIVE_HTML_ELEMENT", element);
239+
});
240+
229241
test('"[types.setActiveLayer]" action calls the "SET_ACTIVE_LAYER" mutation', () => {
230242
const element = { text: "form", id: Date.now() };
231243
const commit = jest.fn();
232244
actions[types.setActiveLayer]({ commit }, element);
233245
expect(commit).toHaveBeenCalledWith("SET_ACTIVE_LAYER", element);
234246
});
235-
})
236-
237-
// ADD NESTED HTML
238-
// ADD NESTED NO ACTIVE
239-
// SET ACTIVE HTML ELEMENT
240-
// ADD TO COMPONENT HTML LIST
241-
// DELETE FROM COMPONENT HTML LIST
242-
// ADD TO SELECTED ELEMENT LIST
243-
// SET SELECTED ELEMENT LIST
244-
// SET CLICKED ELEMENT LIST
245-
// DELETE SELECTED ELEMENT
247+
248+
test('"[types.upOneLayer]" action calls the "UP_ONE_LAYER" mutation', () => {
249+
const id = Date.now();
250+
const commit = jest.fn();
251+
actions[types.upOneLayer]({ commit }, id);
252+
expect(commit).toHaveBeenCalledWith("UP_ONE_LAYER", id);
253+
});
254+
255+
test('"[types.deleteFromComponentHtmlList]" action calls the "DELETE_FROM_COMPONENT_HTML_LIST" mutation', () => {
256+
const id = Date.now();
257+
const commit = jest.fn();
258+
actions[types.deleteFromComponentHtmlList]({ commit }, id);
259+
expect(commit).toHaveBeenCalledWith("DELETE_FROM_COMPONENT_HTML_LIST", id);
260+
});
261+
262+
test('"[types.deleteSelectedElement]" action calls the "DELETE_SELECTED_ELEMENT" mutation', () => {
263+
const idx = 0;
264+
const commit = jest.fn();
265+
actions[types.deleteSelectedElement]({ commit }, idx);
266+
expect(commit).toHaveBeenCalledWith("DELETE_SELECTED_ELEMENT", idx);
267+
});
268+
269+
test('"[types.setClickedElementList]" action calls the "SET_CLICKED_ELEMENT_LIST" mutation', () => {
270+
const element = { text: "form", id: Date.now() };
271+
const commit = jest.fn();
272+
actions[types.setClickedElementList]({ commit }, element);
273+
expect(commit).toHaveBeenCalledWith("SET_CLICKED_ELEMENT_LIST", element);
274+
});
275+
})

0 commit comments

Comments
 (0)