Skip to content

Commit 490ea31

Browse files
LiSminotlee
authored andcommitted
test: test deletion works with aliases
1 parent a068aac commit 490ea31

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

test/unit/lib/calculate-label-diff.test.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,24 @@ describe('lib/calculate-label-diff', () => {
168168
{
169169
name: 'foo',
170170
color: 'ff0000',
171+
},
172+
{
173+
name: 'bar',
174+
color: '00ff00',
171175
}
172176
];
173177
configuredLabels = [
174178
{
175179
name: 'foo',
176-
delete: true
180+
delete: true,
181+
aliases: ['bar']
177182
}
178183
];
179184
diff = calculateLabelDiff(currentLabels, configuredLabels);
180185
});
181186

182-
it('should add an "added" entry to the returned diff', () => {
183-
assert.lengthEquals(diff, 1);
187+
it('should add an "added" entry to the returned diff for each match', () => {
188+
assert.lengthEquals(diff, 2);
184189
assert.deepEqual(diff[0], {
185190
name: 'foo',
186191
type: 'added',
@@ -190,6 +195,15 @@ describe('lib/calculate-label-diff', () => {
190195
},
191196
expected: null
192197
});
198+
assert.deepEqual(diff[1], {
199+
name: 'bar',
200+
type: 'added',
201+
actual: {
202+
name: 'bar',
203+
color: '00ff00',
204+
},
205+
expected: null
206+
});
193207
});
194208

195209
});

0 commit comments

Comments
 (0)