Update prettier
This commit is contained in:
committed by
Umputun
parent
11f222c6e3
commit
71e0e98e05
@@ -186,7 +186,7 @@ const authPanelMessages = defineMessages({
|
||||
},
|
||||
});
|
||||
|
||||
export default function() {
|
||||
export default function () {
|
||||
const dispatch = useDispatch();
|
||||
const provider = useSelector<StoreState, ProviderState>(store => store.provider);
|
||||
const user = useSelector<StoreState, User | null>(store => store.user);
|
||||
|
||||
+3
-6
@@ -32,11 +32,8 @@ describe('<SubscribeByRSS/>', () => {
|
||||
});
|
||||
|
||||
it('should have userId in site link', () => {
|
||||
expect(
|
||||
wrapper
|
||||
.find('.comment-form__rss-dropdown__link')
|
||||
.at(1)
|
||||
.prop('href')
|
||||
).toEqual(createSubscribeUrl('site', '&user=user-1'));
|
||||
expect(wrapper.find('.comment-form__rss-dropdown__link').at(1).prop('href')).toEqual(
|
||||
createSubscribeUrl('site', '&user=user-1')
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -552,18 +552,20 @@ export class CommentForm extends Component<Props, State> {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{// TODO: it can be more elegant;
|
||||
// for example it can render full comment component here (or above textarea on mobile)
|
||||
!!preview && (
|
||||
<div className="comment-form__preview-wrapper">
|
||||
<div
|
||||
className={b('comment-form__preview', {
|
||||
mix: b('raw-content', {}, { theme: props.theme }),
|
||||
})}
|
||||
dangerouslySetInnerHTML={{ __html: preview }}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{
|
||||
// TODO: it can be more elegant;
|
||||
// for example it can render full comment component here (or above textarea on mobile)
|
||||
!!preview && (
|
||||
<div className="comment-form__preview-wrapper">
|
||||
<div
|
||||
className={b('comment-form__preview', {
|
||||
mix: b('raw-content', {}, { theme: props.theme }),
|
||||
})}
|
||||
dangerouslySetInnerHTML={{ __html: preview }}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -158,22 +158,12 @@ describe('<Comment />', () => {
|
||||
const voteButtons = element.find('.comment__vote');
|
||||
expect(voteButtons.length).toStrictEqual(2);
|
||||
|
||||
expect(
|
||||
voteButtons
|
||||
.at(0)
|
||||
.getDOMNode()
|
||||
.getAttribute('aria-disabled')
|
||||
).toStrictEqual('true');
|
||||
expect(voteButtons.at(0).getDOMNode().getAttribute('aria-disabled')).toStrictEqual('true');
|
||||
voteButtons.at(0).simulate('click');
|
||||
await sleep(100);
|
||||
expect(voteSpy).not.toBeCalled();
|
||||
|
||||
expect(
|
||||
voteButtons
|
||||
.at(1)
|
||||
.getDOMNode()
|
||||
.getAttribute('aria-disabled')
|
||||
).toStrictEqual('false');
|
||||
expect(voteButtons.at(1).getDOMNode().getAttribute('aria-disabled')).toStrictEqual('false');
|
||||
voteButtons.at(1).simulate('click');
|
||||
await sleep(100);
|
||||
expect(voteSpy).toBeCalled();
|
||||
@@ -192,22 +182,12 @@ describe('<Comment />', () => {
|
||||
const voteButtons = element.find('.comment__vote');
|
||||
expect(voteButtons.length).toStrictEqual(2);
|
||||
|
||||
expect(
|
||||
voteButtons
|
||||
.at(1)
|
||||
.getDOMNode()
|
||||
.getAttribute('aria-disabled')
|
||||
).toStrictEqual('true');
|
||||
expect(voteButtons.at(1).getDOMNode().getAttribute('aria-disabled')).toStrictEqual('true');
|
||||
voteButtons.at(1).simulate('click');
|
||||
await sleep(100);
|
||||
expect(voteSpy).not.toBeCalled();
|
||||
|
||||
expect(
|
||||
voteButtons
|
||||
.at(0)
|
||||
.getDOMNode()
|
||||
.getAttribute('aria-disabled')
|
||||
).toStrictEqual('false');
|
||||
expect(voteButtons.at(0).getDOMNode().getAttribute('aria-disabled')).toStrictEqual('false');
|
||||
voteButtons.at(0).simulate('click');
|
||||
await sleep(100);
|
||||
expect(voteSpy).toBeCalled();
|
||||
|
||||
Reference in New Issue
Block a user