github.com/outbrain/consul@v1.4.5/ui-v2/tests/unit/utils/hasStatus-test.js (about)

     1  import hasStatus from 'consul-ui/utils/hasStatus';
     2  import { module, test, skip } from 'qunit';
     3  
     4  module('Unit | Utility | has status');
     5  
     6  const checks = {
     7    filterBy: function(prop, value) {
     8      return { length: 0 };
     9    },
    10  };
    11  test('it returns true when passing an empty string (therefore "all")', function(assert) {
    12    assert.ok(hasStatus(checks, ''));
    13  });
    14  test('it returns false when passing an actual status', function(assert) {
    15    ['passing', 'critical', 'warning'].forEach(function(item) {
    16      assert.ok(!hasStatus(checks, item), `, with ${item}`);
    17    });
    18  });
    19  skip('it works as a factory, passing ember `get` in to create the function');