New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[amp-sidebar 1.0] [Toolbar] Added Tests for Current Toolbar functionality #10084
[amp-sidebar 1.0] [Toolbar] Added Tests for Current Toolbar functionality #10084
Conversation
create new file for testing toolbar.js |
@@ -0,0 +1,243 @@ | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to test-toolbar.js
import {timerFor} from '../../../../src/services'; | ||
import {toggleExperiment} from '../../../../src/experiments'; | ||
import * as sinon from 'sinon'; | ||
import '../amp-sidebar'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this import toolbar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toolbar requires and amp-sidebar element to be instantiated. So we need to create one for toolbar to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stub one or more dummy amp-sidebar element(s), and test that is ideally how unit tests should work.
Relates to #9985
Thais creates some basic unit tests for the added functionality of toolbar. Except for reaming features and styling.