Skip to content
This repository was archived by the owner on Aug 25, 2021. It is now read-only.

Conversation

PanSpagetka
Copy link
Contributor

Update Tagging according to patternfly/patternfly-react#351

Update reducers, tests, stories to be consistent with these changes.

Because it looks PF PR may not be merged soon, introduce back css files.

TagSelector.propTypes = {
tagCategories: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.number,
Copy link
Contributor

Choose a reason for hiding this comment

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

isRequired

}).isRequired
).isRequired,
selectedOption: PropTypes.shape({
id: PropTypes.number,
Copy link
Contributor

Choose a reason for hiding this comment

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

^^

};

TagSelector.defaultProps = {
infoText: 'Only a single value can be assigned from these categories',
Copy link
Contributor

Choose a reason for hiding this comment

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

strings can be __('....')

import { __ } from '../../globalFunctions'

tagCategory: this.props.selectedTagCategory,
tagValue: selectedTagValue
};
if (this.findSelectedCat(this.props.selectedTagCategory).singleValue) {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo? maybe findSelectedTag? instead of cat

this.findSelectedCat(this.props.selectedTagCategory).values) ||
[];

findSelectedCat = (selectedTagCategory = { id: undefined }) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

tag not cat

onTagCategoryChange={onTagCategoryChange}
tagCategories={tagCategories}
/>);
const component = renderer.create(
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change this to enyzme, reactRenderer will be removed in future. Examples in #39

}
];

function onChange(x) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use jest.fn() for mock functions


TagView.defaultProps = {
header: 'Assigned tags'
header: 'Assigned tags',
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n

@miq-bot
Copy link
Member

miq-bot commented Jun 25, 2018

This pull request is not mergeable. Please rebase and repush.

@PanSpagetka PanSpagetka force-pushed the tagging-before-pf branch 3 times, most recently from 7af0aea to 8f8e58f Compare June 26, 2018 11:26
@Hyperkid123
Copy link
Contributor

Seems OK

@PanSpagetka PanSpagetka force-pushed the tagging-before-pf branch 6 times, most recently from e27a107 to 4762d1a Compare June 26, 2018 13:12
@miq-bot
Copy link
Member

miq-bot commented Jun 26, 2018

Checked commits PanSpagetka/react-ui-components@888c3c7~...4762d1a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 👍

Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

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

LGTM

@karelhala karelhala merged commit 7676d7b into ManageIQ:master Jun 26, 2018
expect(onTagCategoryChange.mock.calls).toHaveLength(1);
wrapper.instance().onTagValueChange('wawa');
expect(onTagCategoryChange.mock.calls.length).toEqual(1);
expect(onTagCategoryChange.mock.calls).toHaveLength(1);
Copy link
Contributor

@himdel himdel Feb 20, 2019

Choose a reason for hiding this comment

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

@PanSpagetka Are you testing that onTagCategoryChange does not get called when you call onTagValueChange?

Or is this a copypaste bug and the other 2 functions should also have 1 call?
(3 expects testing the same method vs 3 different method calls)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Such PR necromancy :D I don't really remember, but I think that it is testing that each function was called once. I am sorry, but I don't understand where is the problem?

Copy link
Contributor

@himdel himdel Feb 21, 2019

Choose a reason for hiding this comment

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

You're calling each of the 3 functions...

and then testing the first one was called only once, and testing it 3 times ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants