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: techOrder names can be camelCased. #4277

Merged
merged 7 commits into from
Apr 12, 2017
Merged

fix: techOrder names can be camelCased. #4277

merged 7 commits into from
Apr 12, 2017

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Apr 12, 2017

In the new middleware work, the way that new sources were loaded was refactored. We also recently made techs and components work either TitleCased or camelcased. There was one comparison that didn't do the proper check and cause the tech to be reloaded, even if the two techs were the same.

@@ -21,3 +21,7 @@ function toTitleCase(string) {
}

export default toTitleCase;

export function titleCaseEquals(str1, str2) {
Copy link
Member

Choose a reason for hiding this comment

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

JSDoc?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Also, we need some tests, probably.

@brandonocasey
Copy link
Contributor

should we update any other if checks to use the new titleCaseEquals function?

@gkatsev
Copy link
Member Author

gkatsev commented Apr 12, 2017

@brandonocasey I think updates to current code should be done in another PR.

@brandonocasey
Copy link
Contributor

@gkatsev OK

* Compares the TitleCase versions of the two strings for equality.
*
* @param {string} str1
* The first string to compare
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want a newline between this param and the other one for consistency

assert.ok(titleCaseEquals('foo', 'foo'), 'foo equals foo');
assert.ok(titleCaseEquals('foo', 'Foo'), 'foo equals Foo');
assert.ok(titleCaseEquals('Foo', 'foo'), 'Foo equals foo');
assert.ok(titleCaseEquals('Foo', 'Foo'), 'Foo equals Foo');
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe some negative tests with notOK too? fOO & foo etc

Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

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

LGTM

@gkatsev gkatsev merged commit 92e5d9f into master Apr 12, 2017
@gkatsev gkatsev deleted the fix-tech-loading branch April 12, 2017 21:17
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