• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ckeditor / ckeditor5-inspector / 549

pending completion
549

push

travis-ci-com

web-flow
Bump webpack from 5.75.0 to 5.76.0

Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

521 of 560 branches covered (93.04%)

Branch coverage included in aggregate %.

1123 of 1165 relevant lines covered (96.39%)

113.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/commands/data/reducer.js
1
/**
2
 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
 * For licensing, see LICENSE.md.
4
 */
5

6
import {
7
        SET_COMMANDS_CURRENT_COMMAND_NAME,
8
        UPDATE_COMMANDS_STATE
9
} from './actions';
10

11
import {
12
        SET_EDITORS,
13
        SET_CURRENT_EDITOR_NAME,
14
        SET_ACTIVE_INSPECTOR_TAB
15
} from '../../data/actions';
16

17
import {
18
        getCommandsTreeDefinition,
19
        getEditorCommandDefinition
20
} from './utils';
21

22
export default function commandsReducer( globalState, commandsState, action ) {
23
        // Performance optimization: don't create the commands state unless necessary.
24
        if ( globalState.ui.activeTab !== 'Commands' ) {
205✔
25
                return commandsState;
178✔
26
        }
27

28
        if ( !commandsState ) {
27✔
29
                return getBlankCommandsState( globalState, commandsState );
15✔
30
        }
31

32
        switch ( action.type ) {
12!
33
                case SET_COMMANDS_CURRENT_COMMAND_NAME:
34
                        return {
2✔
35
                                ...commandsState,
36

37
                                currentCommandDefinition: getEditorCommandDefinition( globalState, action.currentCommandName ),
38
                                currentCommandName: action.currentCommandName
39
                        };
40

41
                // * SET_ACTIVE_INSPECTOR_TAB – Because of the performance optimization at the beginning, update the state
42
                // if we're back in the commands tab.
43
                // * UPDATE_MODEL_STATE – An action called by the editorEventObserver for the model document change.
44
                case SET_ACTIVE_INSPECTOR_TAB:
45
                case UPDATE_COMMANDS_STATE:
46
                        return {
4✔
47
                                ...commandsState,
48

49
                                currentCommandDefinition: getEditorCommandDefinition( globalState, commandsState.currentCommandName ),
50
                                treeDefinition: getCommandsTreeDefinition( globalState, commandsState )
51
                        };
52

53
                // Actions related to the external state.
54
                case SET_EDITORS:
55
                case SET_CURRENT_EDITOR_NAME:
56
                        return getBlankCommandsState( globalState, commandsState );
6✔
57

58
                default:
59
                        return commandsState;
×
60
        }
61
}
62

63
function getBlankCommandsState( globalState, commandsState = {} ) {
×
64
        return {
21✔
65
                ...commandsState,
66

67
                currentCommandName: null,
68
                currentCommandDefinition: null,
69
                treeDefinition: getCommandsTreeDefinition( globalState, commandsState )
70
        };
71
}
72

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc