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

fix(select): add tests for select label package #2289

Merged
merged 12 commits into from
Feb 22, 2018

Conversation

moog16
Copy link
Contributor

@moog16 moog16 commented Feb 21, 2018

Tests for #2244. This should increase test coverage.

});


test('adapter#removeClass adds a class to the root element', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/adds/removes/

const {component} = setupTest();
component.foundation_.styleFloat = td.function();
component.float();
td.verify(component.foundation_.styleFloat(td.matchers.anything()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace anything() with isA(String)?

const {component} = setupTest();
component.foundation_.styleFloat = td.func();
component.float();
td.verify(component.foundation_.styleFloat(td.matchers.anything()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My previous comment got hidden due to the next commit for some reason, but still applies: anything -> isA(String)

@codecov-io
Copy link

codecov-io commented Feb 21, 2018

Codecov Report

Merging #2289 into master will increase coverage by 0.4%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #2289     +/-   ##
=========================================
+ Coverage    98.8%   99.21%   +0.4%     
=========================================
  Files          96       96             
  Lines        3943     3943             
  Branches      508      508             
=========================================
+ Hits         3896     3912     +16     
+ Misses         47       31     -16
Impacted Files Coverage Δ
packages/mdc-select/label/foundation.js 100% <ø> (+71.42%) ⬆️
packages/mdc-select/label/index.js 100% <100%> (+75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc13750...88cbd73. Read the comment docs.

suite('MDCSelectLabelFoundation');

test('exports cssClasses', () => {
assert.isTrue('cssClasses' in MDCSelectLabelFoundation);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add another statement here, assert.deepEqual(MDCSelectLabelFoundation.cssClasses, cssClasses);

const {component} = setupTest();
component.foundation_.styleFloat = td.func();
component.float('value');
td.verify(component.foundation_.styleFloat(td.matchers.isA(String)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I'm silly and didn't realize you're defining the actual string right above this. Assign 'value' to a const and reference it in both float() and styleFloat(). (It's expected to pass it through, right?)

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo, otherwise LGTM

});


test('adapter#removeClass removes a class to the root element', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/to/from/

@kfranqueiro kfranqueiro self-assigned this Feb 22, 2018
@moog16 moog16 merged commit b8ae66c into master Feb 22, 2018
@moog16 moog16 deleted the fix/select/add-tests-for-label branch February 22, 2018 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants