Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Aug 3, 2023
1 parent ba1f28a commit bf77f30
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ describe("<ManageRestrictedJoinRuleDialog />", () => {
const getComponent = (props = {}) =>
render(<ManageRestrictedJoinRuleDialog room={room} onFinished={onFinished} {...props} />);

it("should render empty state", () => {
expect(getComponent().asFragment()).toMatchSnapshot();
});

it("should list spaces which are not parents of the room", () => {
const space1 = new Room("!space:server", mockClient, userId);
space1.name = "Other Space";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,104 @@ exports[`<ManageRestrictedJoinRuleDialog /> should list spaces which are not par
/>
</DocumentFragment>
`;

exports[`<ManageRestrictedJoinRuleDialog /> should render empty state 1`] = `
<DocumentFragment>
<div
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
aria-labelledby="mx_BaseDialog_title"
class="mx_ManageRestrictedJoinRuleDialog"
data-focus-lock-disabled="false"
role="dialog"
>
<div
class="mx_Dialog_header mx_Dialog_headerWithCancel"
>
<h2
class="mx_Heading_h3 mx_Dialog_title"
id="mx_BaseDialog_title"
>
Select spaces
</h2>
<div
aria-label="Close dialog"
class="mx_AccessibleButton mx_Dialog_cancelButton"
role="button"
tabindex="0"
/>
</div>
<p>
<span>
Decide which spaces can access this room. If a space is selected, its members can find and join
<b>
!roomId:server
</b>
.
</span>
</p>
<div
class="mx_SearchBox mx_textinput"
>
<input
autocomplete="off"
class="mx_textinput_icon mx_textinput_search mx_textinput_icon mx_textinput_search"
data-testid="searchbox-input"
placeholder="Search spaces"
type="text"
value=""
/>
<div
class="mx_AccessibleButton mx_SearchBox_closeButton"
role="button"
tabindex="-1"
/>
</div>
<div
class="mx_AutoHideScrollbar mx_ManageRestrictedJoinRuleDialog_content"
tabindex="-1"
>
<span
class="mx_ManageRestrictedJoinRuleDialog_noResults"
>
No results
</span>
</div>
<div
class="mx_ManageRestrictedJoinRuleDialog_footer"
>
<div
class="mx_ManageRestrictedJoinRuleDialog_section_info"
>
You're removing all spaces. Access will default to invite only
</div>
<div
class="mx_ManageRestrictedJoinRuleDialog_footer_buttons"
>
<div
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary_outline"
role="button"
tabindex="0"
>
Cancel
</div>
<div
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary"
role="button"
tabindex="0"
>
Confirm
</div>
</div>
</div>
</div>
<div
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
</DocumentFragment>
`;

0 comments on commit bf77f30

Please sign in to comment.