Skip to content

Commit

Permalink
[Misc] Add missing SchemaBaseLogic state check
Browse files Browse the repository at this point in the history
- Missed this in elastic#99548
  • Loading branch information
cee-chen committed May 12, 2021
1 parent 8d485cb commit 12dea36
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ describe('SchemaBaseLogic', () => {

describe('listeners', () => {
describe('loadSchema', () => {
it('sets dataLoading to true', () => {
mount({ dataLoading: false });

SchemaBaseLogic.actions.loadSchema();

expect(SchemaBaseLogic.values).toEqual({
...DEFAULT_VALUES,
dataLoading: true,
});
});

it('should make an API call and then set schema state', async () => {
http.get.mockReturnValueOnce(Promise.resolve(MOCK_RESPONSE));
mount();
Expand Down

0 comments on commit 12dea36

Please sign in to comment.