7338 refactor actionbar and contextmenu to use the context store (#7462)

Closes #7338
This commit is contained in:
Raphaël Bosi
2024-10-10 13:26:19 +02:00
committed by GitHub
parent 54c328a7e6
commit a7d5aa933d
84 changed files with 1481 additions and 954 deletions
@@ -0,0 +1,19 @@
import { turnIntoUndefinedIfWhitespacesOnly } from '../turnIntoUndefinedIfWhitespacesOnly';
describe('turnIntoUndefinedIfWhitespacesOnly', () => {
it('should return undefined for whitespace-only input', () => {
expect(turnIntoUndefinedIfWhitespacesOnly(' ')).toBeUndefined();
expect(turnIntoUndefinedIfWhitespacesOnly('\t\n ')).toBeUndefined();
expect(turnIntoUndefinedIfWhitespacesOnly(' \n\r\t')).toBeUndefined();
});
it('should return the original string for non-whitespace input', () => {
expect(turnIntoUndefinedIfWhitespacesOnly('hello')).toBe('hello');
expect(turnIntoUndefinedIfWhitespacesOnly(' hello ')).toBe(' hello ');
expect(turnIntoUndefinedIfWhitespacesOnly('123')).toBe('123');
});
it('should handle empty string input', () => {
expect(turnIntoUndefinedIfWhitespacesOnly('')).toBeUndefined();
});
});