Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Test for React Edit Comment #9713

Merged
merged 2 commits into from
Jun 1, 2021

Conversation

noi5e
Copy link
Contributor

@noi5e noi5e commented Jun 1, 2021

Part of the React rewrite of the comment system. See #9365

Added system test for editing comments that handles both React and Rails comment systems.

Also tweaked the CommentToolbarButton component so that it displays a class for edit-comment-btns


(This issue is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)

@gitpod-io
Copy link

gitpod-io bot commented Jun 1, 2021

@@ -247,28 +276,6 @@ def get_path(page_type, path)
assert_selector('.btn[data-original-title="Help"]', count: 1)
end

test "#{page_type_string}: edit comment" do
nodes(node_name).add_comment({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting this system test, as it's replaced by the new one.

@codeclimate
Copy link

codeclimate bot commented Jun 1, 2021

Code Climate has analyzed commit ed41c83 and detected 0 issues on this pull request.

View more on Code Climate.

@codecov
Copy link

codecov bot commented Jun 1, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@7fe537a). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9713   +/-   ##
=======================================
  Coverage        ?   82.01%           
=======================================
  Files           ?       98           
  Lines           ?     5928           
  Branches        ?        0           
=======================================
  Hits            ?     4862           
  Misses          ?     1066           
  Partials        ?        0           

@jywarren
Copy link
Member

jywarren commented Jun 1, 2021

This looks awesome. Thanks @noi5e!

I did want to note i saw a warning in the Jenkins build log:

WARNING in ./app/javascript/components/REACT_COMMENTS.md 1:0
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> # `React Commenting System`
| 
| **Last Updated: 3/13/2021**
 @ ./app/javascript/components sync ^\.\/.*$ ./REACT_COMMENTS.md
 @ ./app/javascript/packs/server_rendering.js

I want to say i don't think anything broke, but just noting in case it's an issue to look out for.

@jywarren jywarren merged commit 8187469 into publiclab:main Jun 1, 2021
@jywarren
Copy link
Member

jywarren commented Jun 1, 2021

Looks awesome. Merged! Pls give it a spin at https://stable.publiclab.org once it builds -- thanks a ton, @noi5e !!!

@noi5e noi5e deleted the react-tests-edit-delete branch June 1, 2021 22:30
@noi5e
Copy link
Contributor Author

noi5e commented Jun 1, 2021

@jywarren: A little more about that error that you mentioned also here

WARNING in ./app/javascript/components/REACT_COMMENTS.md 1:0
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> # `React Commenting System`
| 
| **Last Updated: 3/13/2021**
 @ ./app/javascript/components sync ^\.\/.*$ ./REACT_COMMENTS.md
 @ ./app/javascript/packs/server_rendering.js

This is occurring because webpacker is trying to parse ./app/javascript/components/REACT_COMMENTS.md (which is written in Markdown), as if it's a .jsx file.

webpacker encounters #, which is the first character in REACT_COMMENTS.md. It throws an error, because this isn't syntactical in .jsx.

It's a minor thing and low-priority IMO, but would be good to take care of down the line. The webpacker config needs to be altered. I'll put it on my to-do.

@jywarren
Copy link
Member

jywarren commented Jun 2, 2021

Thank you this makes total sense. 💫💫💫

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* add edit/delete class for button publiclab#9365

* add test for edit comment publiclab#9365
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* add edit/delete class for button publiclab#9365

* add test for edit comment publiclab#9365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants