Skip to content
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

Merged
merged 11 commits into from Jun 26, 2017

Conversation

torch2424
Copy link
Contributor

Relates to #9985

Thais creates some basic unit tests for the added functionality of toolbar. Except for reaming features and styling.

@camelburrito
Copy link
Contributor

create new file for testing toolbar.js

@torch2424 torch2424 added this to PRs in AMP Sidebar 1.0 Jun 23, 2017
@@ -0,0 +1,243 @@

/**
Copy link
Contributor

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';
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

@camelburrito camelburrito merged commit 40a7553 into ampproject:master Jun 26, 2017
@torch2424 torch2424 deleted the sidebar-v1-toolbar-tests branch June 26, 2017 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants