Skip to content

Commit 4c24628

Browse files
committed
fix tests
1 parent ab49368 commit 4c24628

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

tests/unit/system/relationships/relationship-payload-manager-test.js

+44-44
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ test('push populates the same RelationshipPayloads for either side of a relation
500500
'hobbies',
501501
userModel,
502502
get(userModel, 'relationshipsByName')
503-
);
503+
);
504504

505505
let hobbyModel = this.store.modelFor('hobby');
506506
let hobbyPayloads =
@@ -531,7 +531,7 @@ test('push does not eagerly populate inverse payloads', function(assert) {
531531
'hobbies',
532532
userModel,
533533
get(userModel, 'relationshipsByName')
534-
);
534+
);
535535

536536
assert.deepEqual(
537537
Object.keys(relationshipPayloads._lhsPayloads),
@@ -542,7 +542,7 @@ test('push does not eagerly populate inverse payloads', function(assert) {
542542
Object.keys(relationshipPayloads._rhsPayloads),
543543
[] ,
544544
'hobby.user payloads not eagerly populated'
545-
);
545+
);
546546

547547
relationshipPayloads.get('user', 1, 'hobbies');
548548

@@ -555,7 +555,7 @@ test('push does not eagerly populate inverse payloads', function(assert) {
555555
Object.keys(relationshipPayloads._rhsPayloads),
556556
['2'] ,
557557
'hobby.user payloads lazily populated'
558-
);
558+
);
559559
});
560560

561561
test('push populates each individual relationship in a payload', function(assert) {
@@ -714,9 +714,9 @@ test('push one side is polymorphic, baseType then subTypes', function(assert) {
714714
}
715715
};
716716

717-
const hatData1 = makeHat('hat', hatData),
718-
bigHatData1 = makeHat('big-hat', hatData),
719-
smallHatData1 = makeHat('small-hat', hatData);
717+
const hatData1 = makeHat('hat', hatData),
718+
bigHatData1 = makeHat('big-hat', hatData),
719+
smallHatData1 = makeHat('small-hat', hatData);
720720

721721
const userData = {
722722
data: {
@@ -748,10 +748,10 @@ test('push one side is polymorphic, subType then baseType', function(assert) {
748748
}
749749
};
750750

751-
const bigHatData1 = makeHat('hat', hatData),
752-
smallHatData1 = makeHat('small-hat', hatData),
753-
hatData1 = makeHat('big-hat', hatData),
754-
included = [bigHatData1, smallHatData1, hatData1];
751+
const bigHatData1 = makeHat('hat', hatData),
752+
smallHatData1 = makeHat('small-hat', hatData),
753+
hatData1 = makeHat('big-hat', hatData),
754+
included = [bigHatData1, smallHatData1, hatData1];
755755

756756
const userData = {
757757
data: {
@@ -762,9 +762,9 @@ test('push one side is polymorphic, subType then baseType', function(assert) {
762762
included
763763
};
764764

765-
const user = run(() => this.store.push(userData)),
766-
finalResult = user.get('hats').mapBy('type'),
767-
expectedResults = included.map(m=>m.type);
765+
const user = run(() => this.store.push(userData)),
766+
finalResult = user.get('hats').mapBy('type'),
767+
expectedResults = included.map(m=>m.type);
768768

769769
assert.deepEqual(finalResult, expectedResults, 'We got all our hats!');
770770
});
@@ -779,16 +779,16 @@ test('push one side is polymorphic, different subtypes', function(assert) {
779779
}
780780
};
781781

782-
const bigHatData1 = makeHat('big-hat', hatData),
783-
smallHatData1 = makeHat('small-hat', hatData),
784-
bigHatData2 = makeHat('big-hat', hatData),
785-
smallHatData2 = makeHat('small-hat', hatData),
786-
included = [
787-
bigHatData1,
788-
smallHatData1,
789-
bigHatData2,
790-
smallHatData2
791-
];
782+
const bigHatData1 = makeHat('big-hat', hatData),
783+
smallHatData1 = makeHat('small-hat', hatData),
784+
bigHatData2 = makeHat('big-hat', hatData),
785+
smallHatData2 = makeHat('small-hat', hatData),
786+
included = [
787+
bigHatData1,
788+
smallHatData1,
789+
bigHatData2,
790+
smallHatData2
791+
];
792792

793793
const userData = {
794794
data: {
@@ -799,9 +799,9 @@ test('push one side is polymorphic, different subtypes', function(assert) {
799799
included
800800
};
801801

802-
const user = run(() => this.store.push(userData)),
803-
finalResult = user.get('hats').mapBy('type'),
804-
expectedResults = included.map(m => m.type);
802+
const user = run(() => this.store.push(userData)),
803+
finalResult = user.get('hats').mapBy('type'),
804+
expectedResults = included.map(m => m.type);
805805

806806
assert.deepEqual(finalResult, expectedResults, 'We got all our hats!');
807807
});
@@ -811,29 +811,29 @@ test('push both sides are polymorphic', function(assert) {
811811
attributes: {},
812812
relationships: {
813813
user: {
814-
data: { id: '2' , type: 'alien' }
814+
data: { id: '1' , type: 'alien' }
815815
}
816816
}
817817
};
818818

819-
const bigHatData1 = makeHat('hat', alienHatData),
820-
hatData1 = makeHat('big-hat', alienHatData),
821-
alienIncluded = [bigHatData1, hatData1];
819+
const bigHatData1 = makeHat('hat', alienHatData),
820+
hatData1 = makeHat('big-hat', alienHatData),
821+
alienIncluded = [bigHatData1, hatData1];
822822

823823
const alienData = {
824-
data: {
825-
id: '1',
826-
type: 'alien',
827-
attributes: {}
828-
},
829-
included: alienIncluded
830-
};
831-
832-
const alien = run(() => this.store.push(alienData)),
833-
alienFinalResult = alien.get('hats').mapBy('type'),
834-
expectedAlienResults = alienIncluded.map(m => m.type);
835-
836-
assert.deepEqual(alienFinalResult, expectedAlienResults, 'We got all alien hats!');
824+
data: {
825+
id: '1',
826+
type: 'alien',
827+
attributes: {}
828+
},
829+
included: alienIncluded
830+
};
831+
832+
const expectedAlienResults = alienIncluded.map(m => m.type),
833+
alien = run(() => this.store.push(alienData)),
834+
alienFinalHats = alien.get('hats').mapBy('type');
835+
836+
assert.deepEqual(alienFinalHats, expectedAlienResults, 'We got all alien hats!');
837837
});
838838

839839
test('handles relationships where both sides are polymorphic', function(assert) {

0 commit comments

Comments
 (0)