-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adding more coverage for insertlinkmodal components
- Loading branch information
Showing
9 changed files
with
380 additions
and
200 deletions.
There are no files selected for viewing
105 changes: 55 additions & 50 deletions
105
src/editors/sharedComponents/InsertLinkModal/BlocksList/__snapshots__/index.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,59 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BlocksList Component snapshot 1`] = ` | ||
<IntlProvider | ||
defaultFormats={Object {}} | ||
defaultLocale="en" | ||
fallbackOnEmptyString={true} | ||
formats={Object {}} | ||
locale="en" | ||
messages={Object {}} | ||
onError={[Function]} | ||
onWarn={[Function]} | ||
textComponent={Symbol(react.fragment)} | ||
> | ||
<BlocksList | ||
blocks={ | ||
Object { | ||
"block-children-1": Object { | ||
"blockId": "edx_block-1", | ||
"displayName": "Block children 1", | ||
"id": "block-children-1", | ||
"legacyWebUrl": "http://localhost/legacy", | ||
"lmsWebUrl": "http://localhost/weburl", | ||
"studentViewUrl": "http://localhost/studentview", | ||
"type": "sequential", | ||
}, | ||
"block-children-2": Object { | ||
"blockId": "edx_block-2", | ||
"displayName": "Block children 2", | ||
"id": "block-children-2", | ||
"legacyWebUrl": "http://localhost/legacy", | ||
"lmsWebUrl": "http://localhost/weburl", | ||
"studentViewUrl": "http://localhost/studentview", | ||
"type": "sequential", | ||
}, | ||
"block-key": Object { | ||
"blockId": "edx_block-1", | ||
"children": Array [ | ||
"block-children-1", | ||
"block-children-2", | ||
], | ||
"displayName": "Any display name", | ||
"id": "block-key", | ||
"legacyWebUrl": "http://localhost/legacy", | ||
"lmsWebUrl": "http://localhost/weburl", | ||
"studentViewUrl": "http://localhost/studentview", | ||
"type": "character", | ||
}, | ||
} | ||
} | ||
onBlockSelected={[Function]} | ||
/> | ||
</IntlProvider> | ||
<div> | ||
<div | ||
class="block-list-container" | ||
> | ||
<div | ||
class="pgn-transition-replace-group position-relative" | ||
> | ||
<div | ||
style="padding: .1px 0px;" | ||
> | ||
<div | ||
class="w-100 d-flex justify-content-space-between p-3 pgn__action-row" | ||
> | ||
<button | ||
class="col-11 py-4 btn btn-tertiary" | ||
data-testid="block-name" | ||
type="button" | ||
> | ||
<span | ||
class="w-100 text-left" | ||
> | ||
Any display name | ||
</span> | ||
</button> | ||
<button | ||
class="col-1 py-4 btn btn-tertiary" | ||
data-testid="block-navigation" | ||
type="button" | ||
> | ||
<span | ||
class="pgn__icon btn-icon-after" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
fill="none" | ||
focusable="false" | ||
height="24" | ||
role="img" | ||
viewBox="0 0 24 24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="m6.49 20.13 1.77 1.77 9.9-9.9-9.9-9.9-1.77 1.77L14.62 12l-8.13 8.13Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 63 additions & 55 deletions
118
src/editors/sharedComponents/InsertLinkModal/SearchBlocks/__snapshots__/index.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,67 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`SearchBlocks Component snapshot 1`] = ` | ||
<IntlProvider | ||
defaultFormats={Object {}} | ||
defaultLocale="en" | ||
fallbackOnEmptyString={true} | ||
formats={Object {}} | ||
locale="en" | ||
messages={Object {}} | ||
onError={[Function]} | ||
onWarn={[Function]} | ||
textComponent={Symbol(react.fragment)} | ||
> | ||
<SearchBlocks | ||
blocks={ | ||
Object { | ||
"block-children-1": Object { | ||
"blockId": "edx_block-1", | ||
"displayName": "Block children 1", | ||
"id": "block-children-1", | ||
"legacyWebUrl": "http://localhost/legacy", | ||
"lmsWebUrl": "http://localhost/weburl", | ||
"path": "Any display name / Block children 1", | ||
"studentViewUrl": "http://localhost/studentview", | ||
"type": "sequential", | ||
}, | ||
"block-children-2": Object { | ||
"blockId": "edx_block-2", | ||
"displayName": "Block children 2", | ||
"id": "block-children-2", | ||
"legacyWebUrl": "http://localhost/legacy", | ||
"lmsWebUrl": "http://localhost/weburl", | ||
"path": "Any display name / Block children 2", | ||
"studentViewUrl": "http://localhost/studentview", | ||
"type": "sequential", | ||
}, | ||
"block-key": Object { | ||
"blockId": "edx_block-1", | ||
"children": Array [ | ||
"block-children-1", | ||
"block-children-2", | ||
], | ||
"displayName": "Any display name", | ||
"id": "block-key", | ||
"legacyWebUrl": "http://localhost/legacy", | ||
"lmsWebUrl": "http://localhost/weburl", | ||
"path": "Any display name", | ||
"studentViewUrl": "http://localhost/studentview", | ||
"type": "sequential", | ||
}, | ||
} | ||
} | ||
onBlockSelected={[MockFunction]} | ||
onSearchFilter={[MockFunction]} | ||
searchInputValue="" | ||
/> | ||
</IntlProvider> | ||
<div> | ||
<div> | ||
<div | ||
class="pgn__searchfield d-flex my-4" | ||
data-testid="search-field" | ||
> | ||
<form | ||
class="pgn__searchfield-form" | ||
role="search" | ||
> | ||
<label | ||
class="m-0" | ||
for="pgn-searchfield-input-1" | ||
> | ||
<span | ||
class="sr-only" | ||
> | ||
search | ||
</span> | ||
</label> | ||
<input | ||
class="form-control" | ||
id="pgn-searchfield-input-1" | ||
name="searchfield-input" | ||
placeholder="Search course pages" | ||
role="searchbox" | ||
type="text" | ||
value="" | ||
/> | ||
<button | ||
class="btn" | ||
type="submit" | ||
> | ||
<span | ||
class="pgn__icon" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
fill="none" | ||
focusable="false" | ||
height="24" | ||
role="img" | ||
viewBox="0 0 24 24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5Zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="sr-only" | ||
> | ||
submit search | ||
</span> | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.