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(classification): Apps to Integrations name change #3726

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

n31
Copy link
Contributor

@n31 n31 commented Oct 28, 2024

Replaced 'application' references in Classification modal with 'integration', based on optional flag variable (by default set to false, so I won't break existing code and will display 'application' as usual). When flag is passed as 'True' then 'Integrations' will be displayed, otherwise 'Applications'. Also, unit tests are added for related changes.

@n31 n31 requested a review from a team as a code owner October 28, 2024 19:11
@CLAassistant
Copy link

CLAassistant commented Oct 28, 2024

CLA assistant check
All committers have signed the CLA.

@greg-in-a-box greg-in-a-box changed the title fix(component/feature): Apps to Integrations name change fix(classifcation): Apps to Integrations name change Oct 28, 2024
@greg-in-a-box greg-in-a-box changed the title fix(classifcation): Apps to Integrations name change fix(classification): Apps to Integrations name change Oct 28, 2024
@n31 n31 force-pushed the display-apps-as-integrations branch from d505d10 to 811fc18 Compare October 28, 2024 19:17
@n31 n31 force-pushed the display-apps-as-integrations branch from 811fc18 to fdce2c6 Compare October 28, 2024 19:19
jpfranco
jpfranco previously approved these changes Oct 28, 2024
Copy link
Contributor

@jpfranco jpfranco left a comment

Choose a reason for hiding this comment

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

LGTM

test('should render SecurityControls with Integration label when using SHORT controlsFormat and shouldDisplayAppsAsIntegrations is true', () => {
wrapper.setProps({ controlsFormat: SHORT, shouldDisplayAppsAsIntegrations: true });
expect(wrapper.find('SecurityControlsItem').prop('message').id).toBe(
messages.shortSharingDownloadIntegration.id,
Copy link
Contributor

Choose a reason for hiding this comment

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

we should be asserting against the hardcoded string, not the id or the variable, if the message changes, none of the new tests will fail if someone else accidentally changes it. this goes for all the tests you are asserting below checking for the correct message to appear.

also this component small enough to convert the test file to RTL where you could see the literal string in the dom so that its not mocked in the rest of the tests.

Comment on lines 251 to 272
'should include correct message when integration download is restricted by %s and integrations are less than maxAppCount and shouldDisplayAppsAsIntegrations is true',
listType => {
accessPolicy = {
app: {
accessLevel: listType,
apps: [{ displayText: 'a' }, { displayText: 'b' }, { displayText: 'c' }],
},
};
const expectedMessage = integrationRestrictionsMessageMap[listType][WITH_APP_LIST];

expect(expectedMessage).toBeTruthy();
expect(getFullSecurityControlsMessages(accessPolicy, 3, true)).toEqual([
{
message: {
...expectedMessage,
values: { appNames: 'a, b, c' },
},
},
]);
},
);

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 need assert against the hardcoded message also, the test is essentially check if the input is provide the correct messages so using the variable here might not be useful because someone could still change the message and these unit tests will still pass same with the test below.

if we do not care about the message in these unit tests and we are just testing the function itself, then maybe updating the test name to reflect that

@mergify mergify bot merged commit 5521acc into box:master Oct 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants