From c05896150c36569ffe9f3e9c1612de0fb920124b Mon Sep 17 00:00:00 2001 From: balanza Date: Tue, 2 Jul 2024 13:14:21 +0200 Subject: [PATCH] remove unused selectors --- .../state/selectors/activityLogsSettings.js | 11 --- .../selectors/activityLogsSettings.test.js | 86 +------------------ 2 files changed, 1 insertion(+), 96 deletions(-) diff --git a/assets/js/state/selectors/activityLogsSettings.js b/assets/js/state/selectors/activityLogsSettings.js index 3c52f35c1b..3e97eda7c1 100644 --- a/assets/js/state/selectors/activityLogsSettings.js +++ b/assets/js/state/selectors/activityLogsSettings.js @@ -11,17 +11,6 @@ export const getActivityLogsSettings = createSelector( }) ); -export const getActivityLogsSettingsLoading = createSelector( - [getActivityLogsSettings], - ({ loading }) => loading -); - -export const getActivityLogsSettingsSaved = createSelector( - [getActivityLogsSettings], - ({ settings: { retention_time } }) => - !!(retention_time && retention_time.value && retention_time.unit) -); - export const getActivityLogsSettingsErrors = createSelector( [getActivityLogsSettings], ({ errors }) => errors diff --git a/assets/js/state/selectors/activityLogsSettings.test.js b/assets/js/state/selectors/activityLogsSettings.test.js index c457134818..fb00ffdb87 100644 --- a/assets/js/state/selectors/activityLogsSettings.test.js +++ b/assets/js/state/selectors/activityLogsSettings.test.js @@ -1,8 +1,4 @@ -import { - getActivityLogsSettings, - getActivityLogsSettingsLoading, - getActivityLogsSettingsSaved, -} from './activityLogsSettings'; +import { getActivityLogsSettings } from './activityLogsSettings'; describe('Activity Logs Settings selector', () => { describe('get activity logs settings', () => { @@ -34,84 +30,4 @@ describe('Activity Logs Settings selector', () => { } ); }); - - describe('get activity logs settings loading', () => { - const scenarios = [ - { - state: { loading: false }, - result: false, - }, - { - state: { loading: true }, - result: true, - }, - ]; - - it.each(scenarios)( - 'should return if the activity logs settings are loading', - ({ state, result }) => { - expect( - getActivityLogsSettingsLoading({ activityLogsSettings: state }) - ).toEqual(result); - } - ); - }); - - describe('get if activity logs settings saved', () => { - const scenarios = [ - { - state: { - loading: false, - settings: { - retention_time: { value: 2, unit: 'week' }, - }, - errors: null, - editing: false, - }, - result: true, - }, - { - state: { - loading: false, - settings: { - retention_time: undefined, - }, - errors: null, - editing: false, - }, - result: false, - }, - { - state: { - loading: false, - settings: { - retention_time: {} /* invalid */, - }, - errors: null, - editing: false, - }, - result: false, - }, - { - state: { - loading: true, - settings: { - retention_time: undefined, - }, - errors: null, - editing: false, - }, - result: false, - }, - ]; - - it.each(scenarios)( - 'should return if the activity logs settings are saved', - ({ state, result }) => { - expect( - getActivityLogsSettingsSaved({ activityLogsSettings: state }) - ).toEqual(result); - } - ); - }); });