/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/rich-text/src/test/join.js
44 строки
982 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import deepFreeze from 'deep-freeze'; import { join } from '../join'; import { getSparseArrayLength } from './helpers'; describe( 'join', () => { const em = { type: 'em' }; const separators = [ ' ', { formats: [ , ], replacements: [ , ], text: ' ', }, ]; separators.forEach( ( separator ) => { it( 'should join records with string separator', () => { const one = { formats: [ , , [ em ] ], replacements: [ , , , ], text: 'one', }; const two = { formats: [ [ em ], , , ], replacements: [ , , , ], text: 'two', }; const three = { formats: [ , , [ em ], , [ em ], , , ], replacements: [ , , , , , , , ], text: 'one two', }; const result = join( [ deepFreeze( one ), deepFreeze( two ) ], separator ); expect( result ).not.toBe( one ); expect( result ).not.toBe( two ); expect( result ).toEqual( three ); expect( getSparseArrayLength( result.formats ) ).toBe( 2 ); } ); } ); } );