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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload fucntion added upon adding location tags #7520

Merged
merged 5 commits into from Feb 19, 2020

Conversation

NitinBhasneria
Copy link
Collaborator

Fixes #7359 (<=== Add issue number here)

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 馃搼 and links the original issue above 馃敆
  • tests pass -- look for a green checkbox 鉁旓笍 a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 馃搧
  • screenshots/GIFs are attached 馃搸 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@codecov
Copy link

codecov bot commented Feb 17, 2020

Codecov Report

Merging #7520 into master will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7520      +/-   ##
==========================================
+ Coverage   81.76%   81.89%   +0.13%     
==========================================
  Files          97       97              
  Lines        5604     5612       +8     
==========================================
+ Hits         4582     4596      +14     
+ Misses       1022     1016       -6     
Impacted Files Coverage 螖
app/controllers/wiki_controller.rb 85.00% <0.00%> (+3.07%) 猬嗭笍

@NitinBhasneria
Copy link
Collaborator Author

NitinBhasneria commented Feb 17, 2020

@cesswairimu @nstjean Can you help me with this error?
Screenshot from 2020-02-17 15-09-04

@NitinBhasneria
Copy link
Collaborator Author

NitinBhasneria commented Feb 17, 2020

@nstjean I dont know why, but my travis test are failing do you know the reason.

@nstjean
Copy link
Contributor

nstjean commented Feb 17, 2020

Ahhhh. Ok. So what's happening is that the test is looking for that badge to pop up immediately just like it usually does when you add a tag. They get added to the page using Javascript. Here's what it looks like when I add two tags without a refresh:
FireShot Capture 290 - 馃巿 Public Lab_ Media - localhost

The problem is, we are now reloading the page which makes it look differently. After refresh:
FireShot Capture 291 - 馃巿 Public Lab_ Media - localhost

When you click on the ... button it shows all the tags:

FireShot Capture 293 - 馃巿 Public Lab_ Media - localhost

So in the test we're going to tell it to click on the ... button before checking for those tag badges.

Here is the test:

test 'adding a location to the wiki' do
visit '/wiki/wiki-page-path/'
# Toggle "Add location" modal
find('a.btn-location').click()
# Enter a location
find('#map_content #coord_button').click()
find('#map_content #lat').set("22")
find('#map_content #lng').set("76")
# Save the location
find('#blurred-location-modal .btn-primary').click()
# Wait for the location to be added
wait_for_ajax
# Make sure proper latitude and longitude tags are added
assert_selector('.tags-list .badge a[href="/tag/lat:22"]', text: "lat:22")
assert_selector('.tags-list .badge a[href="/tag/lon:76"]', text: "lon:76")
end

Right after wait_for_ajax we want to add this:

find('.tags-list a.show-more-tags').click()

That will click on the button to show all the badges! Then the test will be able to find the new tags and pass the test. :)

@NitinBhasneria
Copy link
Collaborator Author

Oh ok thanks @nstjean I will try this.

@NitinBhasneria
Copy link
Collaborator Author

NitinBhasneria commented Feb 18, 2020

@nstjean Thanks all the checks have passed, please review this @cesswairimu .

Copy link
Contributor

@nstjean nstjean left a comment

Choose a reason for hiding this comment

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

Great, thank you for your help!!

@cesswairimu cesswairimu merged commit abe0ca5 into publiclab:master Feb 19, 2020
icarito pushed a commit that referenced this pull request Mar 31, 2020
* Reload function improved

* IMPROVED

* Error removed

* Error removed

* Click function added in post_test.rb
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.

Refresh page upon adding location tags
3 participants