Sha256: 3ec1d8b46398dea66fc054f6e4f564640c71f8ea06edb44090d13279e29b31b7

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

import EmberObject from '../../../lib/system/object';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

moduleFor(
  'system/object/detect',
  class extends AbstractTestCase {
    ['@test detect detects classes correctly'](assert) {
      let A = EmberObject.extend();
      let B = A.extend();
      let C = A.extend();

      assert.ok(EmberObject.detect(EmberObject), 'EmberObject is an EmberObject class');
      assert.ok(EmberObject.detect(A), 'A is an EmberObject class');
      assert.ok(EmberObject.detect(B), 'B is an EmberObject class');
      assert.ok(EmberObject.detect(C), 'C is an EmberObject class');

      assert.ok(!A.detect(EmberObject), 'EmberObject is not an A class');
      assert.ok(A.detect(A), 'A is an A class');
      assert.ok(A.detect(B), 'B is an A class');
      assert.ok(A.detect(C), 'C is an A class');

      assert.ok(!B.detect(EmberObject), 'EmberObject is not a B class');
      assert.ok(!B.detect(A), 'A is not a B class');
      assert.ok(B.detect(B), 'B is a B class');
      assert.ok(!B.detect(C), 'C is not a B class');

      assert.ok(!C.detect(EmberObject), 'EmberObject is not a C class');
      assert.ok(!C.detect(A), 'A is not a C class');
      assert.ok(!C.detect(B), 'B is not a C class');
      assert.ok(C.detect(C), 'C is a C class');
    }
  }
);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/runtime/tests/system/object/detect_test.js
discourse-ember-source-3.5.1.1 dist/es/ember-runtime/tests/system/object/detect_test.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-runtime/tests/system/object/detect_test.js