Skip to content

Commit

Permalink
test: test deletion works with aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
LiSmi authored and notlee committed Mar 8, 2023
1 parent a068aac commit 490ea31
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions test/unit/lib/calculate-label-diff.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,24 @@ describe('lib/calculate-label-diff', () => {
{
name: 'foo',
color: 'ff0000',
},
{
name: 'bar',
color: '00ff00',
}
];
configuredLabels = [
{
name: 'foo',
delete: true
delete: true,
aliases: ['bar']
}
];
diff = calculateLabelDiff(currentLabels, configuredLabels);
});

it('should add an "added" entry to the returned diff', () => {
assert.lengthEquals(diff, 1);
it('should add an "added" entry to the returned diff for each match', () => {
assert.lengthEquals(diff, 2);
assert.deepEqual(diff[0], {
name: 'foo',
type: 'added',
Expand All @@ -190,6 +195,15 @@ describe('lib/calculate-label-diff', () => {
},
expected: null
});
assert.deepEqual(diff[1], {
name: 'bar',
type: 'added',
actual: {
name: 'bar',
color: '00ff00',
},
expected: null
});
});

});
Expand Down

0 comments on commit 490ea31

Please sign in to comment.