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.

Hey dude! First of all, this addon is great - I’m really liking the pretty default styles out of the box.

One question I have though: in acceptance tests, Ember waits for the run loop to clear before continuing. I notice that when I write an acceptance test for notifications, I have to wait clearDuration amount of time before my test continues. This slows down the test and is a little annoying.

It seems like these two methods are causing that to happen. So my resolution was to allow those methods to run, only if Ember isn’t in test mode. (Using the Ember.testing flag would also work, instead of a having to manually toggle a variable on the service.)

Do you think it’s a good idea to incorporate this change into ember-cli-notifications? Alternatively, I can simply extend the notifications service (as part of this recent change), and make the method overrides myself.

I’d love to hear what you think!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jelhancommented, May 12, 2018

Did you tried out to set clearDuration to 1ms in testing environment? I’m using this approach and didn’t faced any issues with it so far.

// config/environment.js
module.exports = function(environment) {
  let ENV = {
    'ember-cli-notifications': {
      autoClear: true
    }
  }

  if (environment === 'test') {
    ENV['ember-cli-notifications'].clearDuration = 1;
  }

  return ENV;
};
1reaction
concertivcommented, Apr 16, 2018

Even with setDefaultClearDuration at 0, the close animation slows down acceptance tests. I guess this is because removeNotification has a hard-coded 500ms delay? https://github.com/stonecircle/ember-cli-notifications/blob/master/addon/services/notification-messages-service.js#L72

Read more comments on GitHub >

github_iconTop Results From Across the Web

COVID-19 Testing: What You Need to Know - CDC
Viral tests look for a current infection with SARS-CoV-2, the virus that causes COVID-19, by testing specimens from your nose or mouth. There...
Read more >
Community-Based Testing Sites for COVID-19 - HHS.gov
Find Testing Resources in Your State. COVID-19 tests are available to everyone in the U.S., including the uninsured. Select your state below to...
Read more >
Testing.com: Order Lab Tests and Blood Tests Online
Hundreds of easy-to-read lab testing guides. Confidential, secure and convenient online lab test ordering powered by trusted physician networks. Compassionate ...
Read more >
Get free at-⁠home COVID-⁠19 tests this winter
15,000+ Free Testing Sites. No-cost antigen and PCR COVID-⁠19 tests are available to everyone in the U.S., including the uninsured, at more than...
Read more >
Find COVID-19 Tests
Find COVID-19 tests near you. Four ways to get tested: free community events or fixed test sites in NC, your medical provider or...
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