Skip to content

Commit 03bc919

Browse files
committed
style undefined narrowind down errors
1 parent 872530c commit 03bc919

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

__tests__/componentReducer.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import reducer from '../app/src/redux/reducers/slice/appStateSlice';
22
import { State, Action } from '../app/src/interfaces/Interfaces';
33
import { initialState } from '../app/src/redux/reducers/slice/appStateSlice';
4+
import styled from '@emotion/styled';
45

56
describe('componentReducer Test', () => {
67
let state: State = initialState;
@@ -173,15 +174,15 @@ describe('componentReducer Test', () => {
173174
expect(state.canvasFocus.childId).toEqual(null);
174175
});
175176
});
176-
177+
177178
// TEST 'UPDATE CSS'
178179
xdescribe('updateCss', () => {
179180
it('should add style to focused component', () => {
180181
const action: Action = {
181182
type: 'appState/updateCss',
182183
payload: {
183184
style: {
184-
backgroundColor: 'gray'
185+
backgroundColor: 'gray',
185186
},
186187
contextParam: {
187188
allContext: []
@@ -192,6 +193,7 @@ describe('componentReducer Test', () => {
192193
const styledComp = state.components.find(
193194
(comp) => comp.id === state.canvasFocus.componentId
194195
);
196+
console.log('styledcomp',styledComp.style)
195197
// expect the style property on targeted comp to equal style property in payload
196198
if (styledComp) {
197199
expect(styledComp.style.backgroundColor).toEqual(

0 commit comments

Comments
 (0)