question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test should ignore whitespace

See original GitHub issue

Challenge Override All Other Styles by using Important has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


<style>
  body {
    background-color: black;
    font-family: Monospace ;
    color: green;
  }
  #orange-text {
    color: orange ;
  }
  .pink-text     {
    color: pink !important ;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>

Similar to #8511, test is not whitespace tolerant.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
erictleungcommented, Aug 23, 2016

@BlauFeuer thanks for the issue. Yes, the test should be able to accommodate for spaces.

This line of code needs to be changed so that the regex is changed so that it allows zero or more spaces between !important and the semicolon.

- /\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important;[^\\.]*\\}/g
+ /\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important\\s*;[^\\.]*\\}/g
0reactions
dhcodescommented, Aug 25, 2016

@BlauFeuer You should be able to rename your current branch using: git branch -m new_branch while on the branch you want to rename locally.

Then you can re-push your changes with a git push -u origin fix/branch-name-here --force.

You may need to commit again too between those two steps, though I’m not sure it will be necessary.

As for the guidelines, I think they do a good job of providing a first-timer with a full git experience which can be helpful to someone just getting into contributing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

toHaveTextContent should ignore whitespace #9 - GitHub
But I'm thinking that dom-testing-library should no longer depend on jest-dom . I think we should make a major version bump to make...
Read more >
java - How to Ignore the white Spaces while compare two files?
This test method doesn't work. The contents of both files are equals, but they have different number of white spaces. How can I...
Read more >
Compare Strings While Ignoring Whitespace in Java | Baeldung
Learn different ways to compare strings while ignoring whitespace in ... Using the replaceAll() method above will remove all spaces in our ...
Read more >
How to ignore whitespace when asserting in ExUnit?
I am currently trying to write tests for some components I have been ... String.trim/1 that only works on leading and trailing whitespace....
Read more >
equalsIgnoringWhitespace function - matcher library - Dart API
In this matcher, "ignoring whitespace" means comparing with all runs of whitespace collapsed to single space characters and leading and trailing whitespace ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found