|
@@ -249,6 +249,18 @@ describe('ApiSource', function () {
|
|
|
matches: expect.anything(),
|
|
|
score: expect.anything(),
|
|
|
}),
|
|
|
+ expect.objectContaining({
|
|
|
+ item: expect.objectContaining({
|
|
|
+ model: expect.objectContaining({
|
|
|
+ slug: 'foo-project',
|
|
|
+ }),
|
|
|
+ sourceType: 'project',
|
|
|
+ resultType: 'route',
|
|
|
+ to: '/organizations/org-slug/alerts/rules/?project=2',
|
|
|
+ }),
|
|
|
+ matches: expect.anything(),
|
|
|
+ score: expect.anything(),
|
|
|
+ }),
|
|
|
expect.objectContaining({
|
|
|
item: expect.objectContaining({
|
|
|
model: expect.objectContaining({
|
|
@@ -278,7 +290,7 @@ describe('ApiSource', function () {
|
|
|
|
|
|
// The return values here are because of fuzzy search matching.
|
|
|
// There are no members that match
|
|
|
- expect(mock.mock.calls[1][0].results).toHaveLength(5);
|
|
|
+ expect(mock.mock.calls[1][0].results).toHaveLength(6);
|
|
|
});
|
|
|
|
|
|
it('render function is called with correct results when API requests partially succeed', async function () {
|
|
@@ -342,7 +354,7 @@ describe('ApiSource', function () {
|
|
|
|
|
|
// The return values here are because of fuzzy search matching.
|
|
|
// There are no members that match
|
|
|
- expect(mock.mock.calls[1][0].results).toHaveLength(5);
|
|
|
+ expect(mock.mock.calls[1][0].results).toHaveLength(6);
|
|
|
expect(mock.mock.calls[1][0].results[0].item.model.slug).toBe('foo-org');
|
|
|
|
|
|
mock.mockClear();
|
|
@@ -351,7 +363,7 @@ describe('ApiSource', function () {
|
|
|
wrapper.update();
|
|
|
|
|
|
// Still have 4 results, but is re-ordered
|
|
|
- expect(mock.mock.calls[0][0].results).toHaveLength(5);
|
|
|
+ expect(mock.mock.calls[0][0].results).toHaveLength(6);
|
|
|
expect(mock.mock.calls[0][0].results[0].item.model.slug).toBe('foo-team');
|
|
|
});
|
|
|
|