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

LogManagementDataSelector_Tests.it_returns_profiles_for_specified_profile_ids unit test method is failing when some of user profile names begin with lower-case letter #393

Closed
mykhaylo-partyka opened this issue Oct 16, 2022 · 1 comment · Fixed by #394
Assignees
Labels
Layer: Log Management Items related to the custom objects & Logger Console app tests Relates to Apex or LWC jest tests Type: Bug Something isn't working

Comments

@mykhaylo-partyka
Copy link

mykhaylo-partyka commented Oct 16, 2022

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

v4.8.3

New Bug Summary

LogManagementDataSelector_Tests.it_returns_profiles_for_specified_profile_ids unit test method is failing when some of user profile names begin with lower-case letter.
E.g.: The test will fail if there are three profiles named 'A', 'b', and 'C'.

This is because SOQL ORDER BY sorting is case-insensitive, and List.sort() method - is case-sensitive.

A solution is to sort both the expected and the returned lists in the same way.

@mykhaylo-partyka mykhaylo-partyka added the Type: Bug Something isn't working label Oct 16, 2022
@jongpie jongpie self-assigned this Oct 20, 2022
@jongpie jongpie added Layer: Log Management Items related to the custom objects & Logger Console app tests Relates to Apex or LWC jest tests labels Oct 27, 2022
@jongpie
Copy link
Owner

jongpie commented Oct 27, 2022

Hi @mykhaylo-partyka thanks for reporting this! I'm not sure why I included the call for List.sort() in the test method - the query in the test method already sorts on name, so List.sort() is conceptually redundant, and in practice apparently breaks the test 😭 . I'll remove that extra usage of List.sort(), it should be fixed in the next release v4.8.4 (PR #394)

jongpie added a commit that referenced this issue Oct 27, 2022
…ist.sort() on the expected results, fixed some failing tests in LoggerCache_Tests and Logger_Tests
jongpie added a commit that referenced this issue Oct 27, 2022
…ave been removed in several queries because sorting didn't serve a functional purpose. Instead, the results are now sorted just in the tests to help with asserting on the returned values

Thanks to @jamessimone for pointing out that the ORDER BY statements weren't really needed in the first place & have a QoL impact
jongpie added a commit that referenced this issue Oct 27, 2022
…ave been removed in several queries because sorting didn't serve a functional purpose. Instead, the results are now sorted just in the tests to help with asserting on the returned values

Thanks to @jamessimone for pointing out that the ORDER BY statements weren't really needed in the first place & have a QoL impact
jongpie added a commit that referenced this issue Oct 28, 2022
…ave been removed in several queries because sorting didn't serve a functional purpose. Instead, the results are now sorted just in the tests to help with asserting on the returned values

Thanks to @jamessimone for pointing out that the ORDER BY statements weren't really needed in the first place & have a QoL impact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: Log Management Items related to the custom objects & Logger Console app tests Relates to Apex or LWC jest tests Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants