This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update core tests to work with jest (#328)
- Loading branch information
Showing
6 changed files
with
60 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
packages/carbon-graphs/tests/unit/core/GraphContent/GraphContent-spec.js
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
packages/carbon-graphs/tests/unit/core/GraphContent/GraphContent.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
import { GraphContent } from '../../../../src/js/core'; | ||
import errors from '../../../../src/js/helpers/errors'; | ||
|
||
describe('GraphContent - when consumed', () => { | ||
let content = null; | ||
beforeEach(() => { | ||
content = new GraphContent(); | ||
}); | ||
it('creates interfaces', () => { | ||
expect(typeof content.load).toEqual('function'); | ||
expect(typeof content.unload).toEqual('function'); | ||
expect(typeof content.resize).toEqual('function'); | ||
expect(typeof content.redraw).toEqual('function'); | ||
}); | ||
it('throws error when load is called without being implemented', () => { | ||
expect(() => { | ||
content.load(); | ||
}).toThrowError(errors.THROW_MSG_CONTENT_LOAD_NOT_IMPLEMENTED); | ||
}); | ||
it('throws error when unload is called without being implemented', () => { | ||
expect(() => { | ||
content.unload(); | ||
}).toThrowError(errors.THROW_MSG_CONTENT_UNLOAD_NOT_IMPLEMENTED); | ||
}); | ||
it('throws error when resize is called without being implemented', () => { | ||
expect(() => { | ||
content.resize(); | ||
}).toThrowError(errors.THROW_MSG_CONTENT_RESIZE_NOT_IMPLEMENTED); | ||
}); | ||
it('throws error when redraw is called without being implemented', () => { | ||
expect(() => { | ||
content.redraw(); | ||
}).toThrowError(errors.THROW_MSG_CONTENT_REDRAW_NOT_IMPLEMENTED); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters