Skip to content

Commit

Permalink
Remove navigation mode selector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Nov 18, 2024
1 parent 4f44c44 commit d636bac
Showing 1 changed file with 0 additions and 78 deletions.
78 changes: 0 additions & 78 deletions packages/block-editor/src/store/test/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ import {
import { RawHTML } from '@wordpress/element';
import { symbol } from '@wordpress/icons';
import { select, dispatch } from '@wordpress/data';
import { store as preferencesStore } from '@wordpress/preferences';

/**
* Internal dependencies
*/
import * as selectors from '../selectors';
import { store } from '../';
import { sectionRootClientIdKey } from '../private-keys';
import { lock } from '../../lock-unlock';

const {
Expand Down Expand Up @@ -4469,13 +4467,6 @@ describe( 'getBlockEditingMode', () => {
blockEditingModes: new Map( [] ),
};

const navigationModeStateWithRootSection = {
...baseState,
settings: {
[ sectionRootClientIdKey ]: 'ef45d5fd-5234-4fd5-ac4f-c3736c7f9337', // The group is the "main" container
},
};

const hasContentRoleAttribute = jest.fn( () => false );

const fauxPrivateAPIs = {};
Expand All @@ -4488,10 +4479,6 @@ describe( 'getBlockEditingMode', () => {
select: jest.fn( () => fauxPrivateAPIs ),
};

afterEach( () => {
dispatch( preferencesStore ).set( 'core', 'editorTool', undefined );
} );

it( 'should return default by default', () => {
expect(
getBlockEditingMode(
Expand Down Expand Up @@ -4614,69 +4601,4 @@ describe( 'getBlockEditingMode', () => {
getBlockEditingMode( state, 'b3247f75-fd94-4fef-97f9-5bfd162cc416' )
).toBe( 'contentOnly' );
} );

it( 'in navigation mode, the root section container is default', () => {
dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
expect(
getBlockEditingMode(
navigationModeStateWithRootSection,
'ef45d5fd-5234-4fd5-ac4f-c3736c7f9337'
)
).toBe( 'default' );
} );

it( 'in navigation mode, anything outside the section container is disabled', () => {
dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
expect(
getBlockEditingMode(
navigationModeStateWithRootSection,
'6cf70164-9097-4460-bcbf-200560546988'
)
).toBe( 'disabled' );
} );

it( 'in navigation mode, sections are contentOnly', () => {
dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
expect(
getBlockEditingMode(
navigationModeStateWithRootSection,
'b26fc763-417d-4f01-b81c-2ec61e14a972'
)
).toBe( 'contentOnly' );
expect(
getBlockEditingMode(
navigationModeStateWithRootSection,
'9b9c5c3f-2e46-4f02-9e14-9fe9515b958f'
)
).toBe( 'contentOnly' );
} );

it( 'in navigation mode, blocks with content attributes within sections are contentOnly', () => {
dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
hasContentRoleAttribute.mockReturnValueOnce( true );
expect(
getBlockEditingMode(
navigationModeStateWithRootSection,
'b3247f75-fd94-4fef-97f9-5bfd162cc416'
)
).toBe( 'contentOnly' );

hasContentRoleAttribute.mockReturnValueOnce( true );
expect(
getBlockEditingMode(
navigationModeStateWithRootSection,
'e178812d-ce5e-48c7-a945-8ae4ffcbbb7c'
)
).toBe( 'contentOnly' );
} );

it( 'in navigation mode, blocks without content attributes within sections are disabled', () => {
dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
expect(
getBlockEditingMode(
navigationModeStateWithRootSection,
'9b9c5c3f-2e46-4f02-9e14-9fed515b958s'
)
).toBe( 'disabled' );
} );
} );

0 comments on commit d636bac

Please sign in to comment.