Skip to content

Commit 3305274

Browse files
committed
Fixes the test errors
- Upgrades jest version to 29.7 - We were getting errors related to the new emmetio import. This is because emmetio formerly compiled to both commonJS and ES modules but now only compileds to ES modules. By default, Babel will ignore node_modules, but Jest does not support ES modules out of the box (only commonJS), so we add a custom transformIgnorePatterns so that Babel knows to transform emmetio to commonJS in the jest environment.
1 parent 5380a05 commit 3305274

File tree

6 files changed

+3580
-8328
lines changed

6 files changed

+3580
-8328
lines changed

.babelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@
6262
}
6363
]
6464
]
65+
},
66+
"test": {
67+
"plugins": [
68+
"babel-plugin-styled-components"
69+
],
70+
"presets": [
71+
"@babel/preset-react",
72+
["@babel/preset-env", {"modules": "cjs"}]
73+
]
6574
}
6675
},
6776
"plugins": [

client/modules/IDE/components/Editor/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ const Editor = (props) => {
678678
<Timer />
679679
</div>
680680
</div>
681-
<div
681+
<article
682682
ref={editorRef}
683683
className={classNames('editor-holder', {
684684
'editor-holder--hidden': file.fileType === 'folder' || file.url

client/modules/IDE/components/EditorAccessibility.unit.test.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ describe('<EditorAccessibility />', () => {
88
it('renders empty message with no lines', () => {
99
render(<EditorAccessibility lintMessages={[]} currentLine={0} />);
1010

11-
expect(
12-
screen.getByRole('listitem', {
13-
description: 'There are no lint messages'
14-
})
15-
).toBeInTheDocument();
11+
expect(screen.getByText(/there are no lint messages/i)).toBeInTheDocument();
1612
});
1713

1814
it('renders lint message', () => {

client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
209209
-ms-flex-direction: column;
210210
flex-direction: column;
211211
gap: 0.16666666666666666rem;
212-
box-shadow: rgba(60,64,67,0.3) 0px 1px 2px 0px, rgba(60,64,67,0.15) 0px 1px 3px 1px;
212+
box-shadow: rgba(60,64,67,0.3) 0px 1px 2px 0px,rgba(60,64,67,0.15) 0px 1px 3px 1px;
213213
min-width: 10rem;
214214
border-radius: 0.16666666666666666rem;
215215
}
@@ -323,7 +323,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
323323
>
324324
<test-file-stub
325325
aria-hidden="true"
326-
classname="sc-fujyAs cSTVlM"
326+
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
327327
focusable="false"
328328
/>
329329
</button>
@@ -339,7 +339,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
339339
>
340340
<test-file-stub
341341
aria-hidden="true"
342-
classname="sc-iqAclL iOZiVo"
342+
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
343343
focusable="false"
344344
/>
345345
</button>
@@ -910,7 +910,7 @@ exports[`Nav renders editor version for mobile 1`] = `
910910
-ms-flex-direction: column;
911911
flex-direction: column;
912912
gap: 0.16666666666666666rem;
913-
box-shadow: rgba(60,64,67,0.3) 0px 1px 2px 0px, rgba(60,64,67,0.15) 0px 1px 3px 1px;
913+
box-shadow: rgba(60,64,67,0.3) 0px 1px 2px 0px,rgba(60,64,67,0.15) 0px 1px 3px 1px;
914914
min-width: 10rem;
915915
border-radius: 0.16666666666666666rem;
916916
}
@@ -1024,7 +1024,7 @@ exports[`Nav renders editor version for mobile 1`] = `
10241024
>
10251025
<test-file-stub
10261026
aria-hidden="true"
1027-
classname="sc-fujyAs cSTVlM"
1027+
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
10281028
focusable="false"
10291029
/>
10301030
</button>
@@ -1040,7 +1040,7 @@ exports[`Nav renders editor version for mobile 1`] = `
10401040
>
10411041
<test-file-stub
10421042
aria-hidden="true"
1043-
classname="sc-iqAclL iOZiVo"
1043+
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
10441044
focusable="false"
10451045
/>
10461046
</button>

0 commit comments

Comments
 (0)