Skip to content

Commit bec7e71

Browse files
committed
fix: unit test
1 parent c548d45 commit bec7e71

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = createConfig('eslint', {
1313
rules: {
1414
'react/function-component-definition': 'off',
1515
'import/prefer-default-export': 'off',
16+
'import/no-extraneous-dependencies': 'off',
1617
},
1718
overrides: [
1819
{

src/components/PluggableComponent/__snapshots__/index.test.jsx.snap

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,31 @@
33
exports[`PluggableComponent renders correctly 1`] = `
44
<div>
55
<div
6-
class="pgn__form-group"
6+
class="pgn__form-group p-3 border border-success-300"
77
data-testid="plugin-input"
88
>
99
<label
10-
class="pgn__form-label"
10+
class="pgn__form-label h3 text-primary-500"
1111
for="randomID"
1212
>
1313
Hello
1414
</label>
1515
<div
16-
class="pgn__form-control-decorator-group"
16+
class="row container-fluid"
1717
>
18-
<input
19-
class="form-control is-valid"
20-
id="randomID"
21-
/>
18+
<div
19+
class="pgn__form-control-decorator-group col-3"
20+
>
21+
<input
22+
class="form-control is-valid"
23+
id="randomID"
24+
/>
25+
</div>
26+
<p
27+
class="col-8"
28+
>
29+
@openedx-plugins/communications-app-input-form
30+
</p>
2231
</div>
2332
<div
2433
class="pgn__form-control-description pgn__form-text pgn__form-text-valid"

src/components/PluggableComponent/index.test.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
// eslint-disable-next-line import/no-extraneous-dependencies
32
import { render, waitFor, screen } from '@testing-library/react';
43
import PluggableComponent from '.';
54

src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ function BulkEmailForm(props) {
276276
id="checkbox-form"
277277
as="communications-app-check-box-form"
278278
label="checkbox label - @openedx-plugins/communications-app-check-box-form"
279-
onChange={() => null}
279+
isChecked
280+
handleChange={() => null}
280281
>
281282
<h1>Checkbox -default</h1>
282283
</PluggableComponent>
@@ -292,7 +293,7 @@ function BulkEmailForm(props) {
292293
<h1>Input -default</h1>
293294
</PluggableComponent>
294295
{/* this will return default child if the plugin has not been installed */}
295-
<PluggableComponent id="input-form" as="communications-app-card">
296+
<PluggableComponent id="card-form" as="communications-app-card">
296297
<Card className="my-4 p-3 col-6 border border-success-300 w-100">
297298
<Card.ImageCap
298299
src="https://picsum.photos/360/200/"

0 commit comments

Comments
 (0)