Commit eb5142cf authored by Tom Quirk's avatar Tom Quirk

Settings_panel_spec: Prefer `toBe` over `toEqual`

parent 283b8ea5
...@@ -162,7 +162,7 @@ describe('Settings Panel', () => { ...@@ -162,7 +162,7 @@ describe('Settings Panel', () => {
it('should set the repository help text when the visibility level is set to private', () => { it('should set the repository help text when the visibility level is set to private', () => {
wrapper = overrideCurrentSettings({ visibilityLevel: visibilityOptions.PRIVATE }); wrapper = overrideCurrentSettings({ visibilityLevel: visibilityOptions.PRIVATE });
expect(findRepositoryFeatureProjectRow().props().helpText).toEqual( expect(findRepositoryFeatureProjectRow().props().helpText).toBe(
'View and edit files in this project', 'View and edit files in this project',
); );
}); });
...@@ -170,7 +170,7 @@ describe('Settings Panel', () => { ...@@ -170,7 +170,7 @@ describe('Settings Panel', () => {
it('should set the repository help text with a read access warning when the visibility level is set to non-private', () => { it('should set the repository help text with a read access warning when the visibility level is set to non-private', () => {
wrapper = overrideCurrentSettings({ visibilityLevel: visibilityOptions.PUBLIC }); wrapper = overrideCurrentSettings({ visibilityLevel: visibilityOptions.PUBLIC });
expect(findRepositoryFeatureProjectRow().props().helpText).toEqual( expect(findRepositoryFeatureProjectRow().props().helpText).toBe(
'View and edit files in this project. Non-project members will only have read access', 'View and edit files in this project. Non-project members will only have read access',
); );
}); });
...@@ -184,7 +184,7 @@ describe('Settings Panel', () => { ...@@ -184,7 +184,7 @@ describe('Settings Panel', () => {
wrapper wrapper
.find('[name="project[project_feature_attributes][merge_requests_access_level]"]') .find('[name="project[project_feature_attributes][merge_requests_access_level]"]')
.props().disabledInput, .props().disabledInput,
).toEqual(false); ).toBe(false);
}); });
it('should disable the merge requests access level input when the repository is disabled', () => { it('should disable the merge requests access level input when the repository is disabled', () => {
...@@ -194,7 +194,7 @@ describe('Settings Panel', () => { ...@@ -194,7 +194,7 @@ describe('Settings Panel', () => {
wrapper wrapper
.find('[name="project[project_feature_attributes][merge_requests_access_level]"]') .find('[name="project[project_feature_attributes][merge_requests_access_level]"]')
.props().disabledInput, .props().disabledInput,
).toEqual(true); ).toBe(true);
}); });
}); });
...@@ -205,7 +205,7 @@ describe('Settings Panel', () => { ...@@ -205,7 +205,7 @@ describe('Settings Panel', () => {
expect( expect(
wrapper.find('[name="project[project_feature_attributes][forking_access_level]"]').props() wrapper.find('[name="project[project_feature_attributes][forking_access_level]"]').props()
.disabledInput, .disabledInput,
).toEqual(false); ).toBe(false);
}); });
it('should disable the forking access level input when the repository is disabled', () => { it('should disable the forking access level input when the repository is disabled', () => {
...@@ -214,7 +214,7 @@ describe('Settings Panel', () => { ...@@ -214,7 +214,7 @@ describe('Settings Panel', () => {
expect( expect(
wrapper.find('[name="project[project_feature_attributes][forking_access_level]"]').props() wrapper.find('[name="project[project_feature_attributes][forking_access_level]"]').props()
.disabledInput, .disabledInput,
).toEqual(true); ).toBe(true);
}); });
}); });
...@@ -225,7 +225,7 @@ describe('Settings Panel', () => { ...@@ -225,7 +225,7 @@ describe('Settings Panel', () => {
expect( expect(
wrapper.find('[name="project[project_feature_attributes][builds_access_level]"]').props() wrapper.find('[name="project[project_feature_attributes][builds_access_level]"]').props()
.disabledInput, .disabledInput,
).toEqual(false); ).toBe(false);
}); });
it('should disable the builds access level input when the repository is disabled', () => { it('should disable the builds access level input when the repository is disabled', () => {
...@@ -234,7 +234,7 @@ describe('Settings Panel', () => { ...@@ -234,7 +234,7 @@ describe('Settings Panel', () => {
expect( expect(
wrapper.find('[name="project[project_feature_attributes][builds_access_level]"]').props() wrapper.find('[name="project[project_feature_attributes][builds_access_level]"]').props()
.disabledInput, .disabledInput,
).toEqual(true); ).toBe(true);
}); });
}); });
...@@ -295,7 +295,7 @@ describe('Settings Panel', () => { ...@@ -295,7 +295,7 @@ describe('Settings Panel', () => {
expect( expect(
wrapper.find('[name="project[container_registry_enabled]"]').props().disabledInput, wrapper.find('[name="project[container_registry_enabled]"]').props().disabledInput,
).toEqual(false); ).toBe(false);
}); });
it('should disable the container registry input when the repository is disabled', () => { it('should disable the container registry input when the repository is disabled', () => {
...@@ -306,7 +306,7 @@ describe('Settings Panel', () => { ...@@ -306,7 +306,7 @@ describe('Settings Panel', () => {
expect( expect(
wrapper.find('[name="project[container_registry_enabled]"]').props().disabledInput, wrapper.find('[name="project[container_registry_enabled]"]').props().disabledInput,
).toEqual(true); ).toBe(true);
}); });
}); });
...@@ -315,7 +315,7 @@ describe('Settings Panel', () => { ...@@ -315,7 +315,7 @@ describe('Settings Panel', () => {
wrapper.setProps({ lfsAvailable: true }); wrapper.setProps({ lfsAvailable: true });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(findLFSSettingsRow().exists()).toEqual(true); expect(findLFSSettingsRow().exists()).toBe(true);
}); });
}); });
...@@ -323,7 +323,7 @@ describe('Settings Panel', () => { ...@@ -323,7 +323,7 @@ describe('Settings Panel', () => {
wrapper.setProps({ lfsAvailable: false }); wrapper.setProps({ lfsAvailable: false });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(findLFSSettingsRow().exists()).toEqual(false); expect(findLFSSettingsRow().exists()).toBe(false);
}); });
}); });
...@@ -337,7 +337,7 @@ describe('Settings Panel', () => { ...@@ -337,7 +337,7 @@ describe('Settings Panel', () => {
{ lfsAvailable: true }, { lfsAvailable: true },
); );
expect(findLFSFeatureToggle().props().disabledInput).toEqual(false); expect(findLFSFeatureToggle().props().disabledInput).toBe(false);
}); });
it('should disable the LFS input when the repository is disabled', () => { it('should disable the LFS input when the repository is disabled', () => {
...@@ -346,7 +346,7 @@ describe('Settings Panel', () => { ...@@ -346,7 +346,7 @@ describe('Settings Panel', () => {
{ lfsAvailable: true }, { lfsAvailable: true },
); );
expect(findLFSFeatureToggle().props().disabledInput).toEqual(true); expect(findLFSFeatureToggle().props().disabledInput).toBe(true);
}); });
it('should not change lfsEnabled when disabling the repository', async () => { it('should not change lfsEnabled when disabling the repository', async () => {
...@@ -393,14 +393,14 @@ describe('Settings Panel', () => { ...@@ -393,14 +393,14 @@ describe('Settings Panel', () => {
expect(message.text()).toContain( expect(message.text()).toContain(
'LFS objects from this repository are still available to forks', 'LFS objects from this repository are still available to forks',
); );
expect(link.text()).toEqual('How do I remove them?'); expect(link.text()).toBe('How do I remove them?');
expect(link.attributes('href')).toEqual( expect(link.attributes('href')).toBe(
'/help/topics/git/lfs/index#removing-objects-from-lfs', '/help/topics/git/lfs/index#removing-objects-from-lfs',
); );
}); });
} else { } else {
it('does not show warning message', () => { it('does not show warning message', () => {
expect(findLFSSettingsMessage().exists()).toEqual(false); expect(findLFSSettingsMessage().exists()).toBe(false);
}); });
} }
}, },
...@@ -412,7 +412,7 @@ describe('Settings Panel', () => { ...@@ -412,7 +412,7 @@ describe('Settings Panel', () => {
wrapper.setProps({ packagesAvailable: true }); wrapper.setProps({ packagesAvailable: true });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.find({ ref: 'package-settings' }).exists()).toEqual(true); expect(wrapper.find({ ref: 'package-settings' }).exists()).toBe(true);
}); });
}); });
...@@ -420,7 +420,7 @@ describe('Settings Panel', () => { ...@@ -420,7 +420,7 @@ describe('Settings Panel', () => {
wrapper.setProps({ packagesAvailable: false }); wrapper.setProps({ packagesAvailable: false });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.find({ ref: 'package-settings' }).exists()).toEqual(false); expect(wrapper.find({ ref: 'package-settings' }).exists()).toBe(false);
}); });
}); });
...@@ -440,9 +440,7 @@ describe('Settings Panel', () => { ...@@ -440,9 +440,7 @@ describe('Settings Panel', () => {
{ packagesAvailable: true }, { packagesAvailable: true },
); );
expect(wrapper.find('[name="project[packages_enabled]"]').props().disabledInput).toEqual( expect(wrapper.find('[name="project[packages_enabled]"]').props().disabledInput).toBe(false);
false,
);
}); });
it('should disable the packages input when the repository is disabled', () => { it('should disable the packages input when the repository is disabled', () => {
...@@ -451,9 +449,7 @@ describe('Settings Panel', () => { ...@@ -451,9 +449,7 @@ describe('Settings Panel', () => {
{ packagesAvailable: true }, { packagesAvailable: true },
); );
expect(wrapper.find('[name="project[packages_enabled]"]').props().disabledInput).toEqual( expect(wrapper.find('[name="project[packages_enabled]"]').props().disabledInput).toBe(true);
true,
);
}); });
}); });
...@@ -532,7 +528,7 @@ describe('Settings Panel', () => { ...@@ -532,7 +528,7 @@ describe('Settings Panel', () => {
}); });
it('should contain help text', () => { it('should contain help text', () => {
expect(wrapper.find({ ref: 'metrics-visibility-settings' }).props().helpText).toEqual( expect(wrapper.find({ ref: 'metrics-visibility-settings' }).props().helpText).toBe(
'With Metrics Dashboard you can visualize this project performance metrics', 'With Metrics Dashboard you can visualize this project performance metrics',
); );
}); });
...@@ -543,7 +539,7 @@ describe('Settings Panel', () => { ...@@ -543,7 +539,7 @@ describe('Settings Panel', () => {
const metricsSettingsRow = wrapper.find({ ref: 'metrics-visibility-settings' }); const metricsSettingsRow = wrapper.find({ ref: 'metrics-visibility-settings' });
expect(wrapper.vm.metricsOptionsDropdownEnabled).toBe(true); expect(wrapper.vm.metricsOptionsDropdownEnabled).toBe(true);
expect(metricsSettingsRow.find('select').attributes('disabled')).toEqual('disabled'); expect(metricsSettingsRow.find('select').attributes('disabled')).toBe('disabled');
}); });
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment