mirror of
https://github.com/nasa/openmct.git
synced 2025-01-11 15:32:56 +00:00
[Search] Update field name
Update field name in GenericSearchProvider to reflect changes from nasa/openmctweb#193. Avoids exceptions on mutation. Additionally, add test case exercising relevant code and verifying that reindexing is scheduled upon mutation as expected.
This commit is contained in:
parent
59f094763b
commit
bf24ac7c93
@ -122,7 +122,7 @@ define([
|
|||||||
|
|
||||||
mutationTopic.listen(function (mutatedObject) {
|
mutationTopic.listen(function (mutatedObject) {
|
||||||
var id = mutatedObject.getId();
|
var id = mutatedObject.getId();
|
||||||
provider.indexed[id] = false;
|
provider.indexedIds[id] = false;
|
||||||
provider.scheduleForIndexing(id);
|
provider.scheduleForIndexing(id);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -99,6 +99,14 @@ define([
|
|||||||
.toHaveBeenCalledWith(jasmine.any(Function));
|
.toHaveBeenCalledWith(jasmine.any(Function));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('reschedules indexing when mutation occurs', function () {
|
||||||
|
var mockDomainObject =
|
||||||
|
jasmine.createSpyObj('domainObj', ['getId']);
|
||||||
|
mockDomainObject.getId.andReturn("some-id");
|
||||||
|
mutationTopic.listen.mostRecentCall.args[0](mockDomainObject);
|
||||||
|
expect(provider.scheduleForIndexing).toHaveBeenCalledWith('some-id');
|
||||||
|
});
|
||||||
|
|
||||||
it('starts indexing roots', function () {
|
it('starts indexing roots', function () {
|
||||||
expect(provider.scheduleForIndexing).toHaveBeenCalledWith('mine');
|
expect(provider.scheduleForIndexing).toHaveBeenCalledWith('mine');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user