11import EmberObject , { get } from '@ember/object' ;
22import { compare } from '@ember/utils' ;
33import Comparable from '../../lib/mixins/comparable' ;
4- import { moduleFor , AbstractTestCase } from 'internal-test-helpers' ;
4+ import { moduleFor , AbstractTestCase , expectDeprecation , testUnless } from 'internal-test-helpers' ;
5+ import { DEPRECATIONS } from '../../../deprecations' ;
56
67class Rectangle extends EmberObject . extend ( Comparable ) {
78 length = 0 ;
@@ -22,11 +23,17 @@ moduleFor(
2223 'Comparable' ,
2324 class extends AbstractTestCase {
2425 beforeEach ( ) {
26+ expectDeprecation (
27+ / T h e ` C o m p a r a b l e ` m i x i n i s d e p r e c a t e d / ,
28+ DEPRECATIONS . DEPRECATE_COMPARABLE_MIXIN . isEnabled
29+ ) ;
2530 r1 = Rectangle . create ( { length : 6 , width : 12 } ) ;
2631 r2 = Rectangle . create ( { length : 6 , width : 13 } ) ;
2732 }
2833
29- [ '@test should be comparable and return the correct result' ] ( assert ) {
34+ [ `${ testUnless (
35+ DEPRECATIONS . DEPRECATE_COMPARABLE_MIXIN . isRemoved
36+ ) } @test should be comparable and return the correct result`] ( assert ) {
3037 assert . equal ( Comparable . detect ( r1 ) , true ) ;
3138 assert . equal ( compare ( r1 , r1 ) , 0 ) ;
3239 assert . equal ( compare ( r1 , r2 ) , - 1 ) ;
0 commit comments