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

Added billboard test link to admin page #20363

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xao0isb
Copy link

@xao0isb xao0isb commented Nov 16, 2023

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Added billboard test link to "edit billboard" page. If "placement area" is selected as the post area then the link is displayed.

Related Tickets & Documents

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Semantic HTML implemented?
  • Keyboard operability supported?
  • Checked with axe DevTools and addressed Critical and Serious issues?
  • Color contrast tested?

For more info, check out the
Forem Accessibility Docs.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above.

  • Yes
  • No, and this is why: I didn't understand how to test the fact that the right test billboard rendered since request.body returns the html code without the billboard code itself because it does not have time to load
  • I need help with writing tests

Added billboard test link to "edit billboard" page. If "placement area" is selected as the post area then the link is displayed.
@xao0isb xao0isb requested review from a team as code owners November 16, 2023 16:47
@xao0isb xao0isb requested review from maestromac and lightalloy and removed request for a team November 16, 2023 16:47
@CLAassistant

This comment was marked as outdated.

Copy link
Contributor

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

Copy link
Contributor

github-actions bot commented Nov 16, 2023

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
@xao0isb
@dmitry Kurtsev
Dmitry Kurtsev seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@xao0isb
Copy link
Author

xao0isb commented Nov 16, 2023

I have read the CLA Document and I hereby sign the CLA

@xao0isb
Copy link
Author

xao0isb commented Nov 16, 2023

As test post I used the last created article. Could you sugest the right way to create the normall test article? I imagine that this is some kind of pre-created article with a test title, test content, etc but I don't know how to implement this.

Also I didn't understand how to test the fact that the right test billboard rendered since request.body returns the html code without the billboard code itself because it does not have time to load. Could you also sugest how to write tests correctly under such conditions? Thanks!

@@ -17,6 +17,7 @@ def new

def edit
@billboard = Billboard.find(params[:id])
@test_article = Article.last
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only include published articles, so Article.published.last should work.

@benhalpern
Copy link
Contributor

@xao0isb thanks for this. I left one comment. Take a look at the CI to see if tests need to be adjusted.

updateTestLinkVisibility();

const newlySelecetedPlacementAreaValue = placementAreaSelect.value;
testPlacementAreaLink.href = testPlacementAreaLink.href.replaceAll(previouslySelecetedPlacementAreaValue, newlySelecetedPlacementAreaValue);

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML

[DOM text](1) is reinterpreted as HTML without escaping meta-characters.
Copy link
Contributor

github-actions bot commented Nov 20, 2023

Uffizzi Ephemeral Environment deployment-41132

☁️ https://app.uffizzi.com/github.com/forem/forem/pull/20363

📄 View Application Logs etc.

What is Uffizzi? Learn more!

@xao0isb xao0isb force-pushed the xao0isb/add-billboard-test-link-to-admin-page-20350 branch from 762cbfb to ad884b5 Compare November 21, 2023 14:46
@xao0isb
Copy link
Author

xao0isb commented Nov 22, 2023

@benhalpern I have finalised the code and fixed the tests. The CLA bot still fails on commit where I didnt configure my mail and used auto generated. How can I fix this? Maybe I should make a new commit with the name that was used in the commit with auto generated mail?

@dambar08
Copy link
Contributor

dambar08 commented Jan 1, 2024

@xao0isb Did you sign the CLA?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants