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

News sources should be owo'd #419

Open
zuzak opened this issue Jan 30, 2020 · 6 comments
Open

News sources should be owo'd #419

zuzak opened this issue Jan 30, 2020 · 6 comments
Labels
easy a change that should take less than 15 minutes for a new contributor feature request good first issue
Milestone

Comments

@zuzak
Copy link
Contributor

zuzak commented Jan 30, 2020

If there's no URL, the breaking news twitter functionality adds a suffix, like "― Al Jazeera".
People on Twitter seem to prefer the suffix to be owo'd.

Acceptance criteria:

  • News stories with URLs should list the URL
  • News stories without URLs should list the source of the news story instead
  • News story sources should be owo'd ("Aw Jazeewa", "Weutews", "BBC")
  • News story URLs should not be owo'd

The code you need to change to fix this is somewhere in the newNews event handler.

@zuzak zuzak added feature request easy a change that should take less than 15 minutes for a new contributor labels Jan 30, 2020
@zuzak zuzak added this to the Twitter milestone Jan 30, 2020
@gauravsofat
Copy link

Hi, I'm new to the project and wish to contribute, can I take this up?

@zuzak
Copy link
Contributor Author

zuzak commented Mar 30, 2020

Sure -- go ahead. Let us know if you need any help.

@gauravsofat
Copy link

gauravsofat commented Mar 30, 2020

Thanks. Had a small initial query — After cloning the repo, running npm install, and then following that by npm test leads to 8 failing tests on my device. Is this expected behaviour/ did I miss some initial setup steps?

Attaching a log of the failed tests, in case that is of any help -


  1) countdown module
       outputs a countdown:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'Article 50 expires in 3 years, 2 months, 4 hours and 30 minutes'
- 'Article 50 expires in 3 years, 1 month, 30 days and 23 hours'
                                  ^
      + expected - actual

      -Article 50 expires in 3 years, 2 months, 4 hours and 30 minutes
      +Article 50 expires in 3 years, 1 month, 30 days and 23 hours
      
      at Context.<anonymous> (test/modules/countdown.js:13:12)
      at processImmediate (internal/timers.js:456:21)

  2) countdown module
       outputs a countdown less than a year to go:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'Article 50 expires in 2 months, 4 hours and 30 minutes'
- 'Article 50 expires in 1 month, 30 days and 23 hours'
                         ^
      + expected - actual

      -Article 50 expires in 2 months, 4 hours and 30 minutes
      +Article 50 expires in 1 month, 30 days and 23 hours
      
      at Context.<anonymous> (test/modules/countdown.js:19:12)
      at processImmediate (internal/timers.js:456:21)

  3) countdown module
       outputs a countdown to the second milestone once we have passed the first:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'The extension request deadline expires in 3 months, 19 days, 4 hours and 30 minutes'
- 'The extension request deadline expires in 3 months, 17 days and 23 hours'
                                                        ^
      + expected - actual

      -The extension request deadline expires in 3 months, 19 days, 4 hours and 30 minutes
      +The extension request deadline expires in 3 months, 17 days and 23 hours
      
      at Context.<anonymous> (test/modules/countdown.js:25:12)
      at processImmediate (internal/timers.js:456:21)

  4) countdown module
       outputs a countdown to the third milestone once we have passed the second:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'The transition period expires in 1 month, 4 hours and 30 minutes'
- 'The transition period expires in 30 days and 23 hours'
                                    ^
      + expected - actual

      -The transition period expires in 1 month, 4 hours and 30 minutes
      +The transition period expires in 30 days and 23 hours
      
      at Context.<anonymous> (test/modules/countdown.js:31:12)
      at processImmediate (internal/timers.js:456:21)

  5) countdown module
       counts down to the 60th PGE in 2025:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'Polls open in 4 years, 3 months, 2 days, 12 hours and 30 minutes'
- 'Polls open in 4 years, 3 months, 2 days and 7 hours'
                                          ^
      + expected - actual

      -Polls open in 4 years, 3 months, 2 days, 12 hours and 30 minutes
      +Polls open in 4 years, 3 months, 2 days and 7 hours
      
      at Context.<anonymous> (test/modules/countdown.js:57:12)
      at processImmediate (internal/timers.js:456:21)

  6) countdown module
       outputs a py2 countdown:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'Python 2.7 support expires in 3 years, 1 month, 5 hours and 30 minutes'
- 'Python 2.7 support expires in 3 years and 1 month'
                                        ^
      + expected - actual

      -Python 2.7 support expires in 3 years, 1 month, 5 hours and 30 minutes
      +Python 2.7 support expires in 3 years and 1 month
      
      at Context.<anonymous> (test/modules/countdown.js:75:12)
      at processImmediate (internal/timers.js:456:21)

  7) countdown module
       outputs a py2 countup:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'Python 2.7 support expired 10 months, 30 days, 18 hours and 30 minutes ago'
- 'Python 2.7 support expired 11 months ago'
                               ^
      + expected - actual

      -Python 2.7 support expired 10 months, 30 days, 18 hours and 30 minutes ago
      +Python 2.7 support expired 11 months ago
      
      at Context.<anonymous> (test/modules/countdown.js:81:12)
      at processImmediate (internal/timers.js:456:21)

  8) radio module
       should parse the API correctly:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'Now: \u000300Midnight News\u000f \u000315(20/03/2019)\u000f followed by Book of the Week in 15 minutes (6:00 am)'
- 'Now: \u000300Midnight News\u000f \u000315(20/03/2019)\u000f followed by Book of the Week in 15 minutes (12:30 am)'
      + expected - actual

      -Now: 00Midnight News 15(20/03/2019) followed by Book of the Week in 15 minutes (6:00 am)
      +Now: 00Midnight News 15(20/03/2019) followed by Book of the Week in 15 minutes (12:30 am)
      
      at Context.<anonymous> (test/modules/radio.js:35:12)

@zuzak
Copy link
Contributor Author

zuzak commented Mar 30, 2020

It should work, but we've had some problems mocking the date function before. Those tests are unrelated to any of the news functionality, so it's safe to ignore them for your purposes.

@gauravsofat
Copy link

Thanks for the quick response! You can assign this issue to me, shall open a PR very soon.

@gauravsofat
Copy link

cc @zuzak to action upon the linked PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy a change that should take less than 15 minutes for a new contributor feature request good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants