Files
upstream-mirror 30810eecd7
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 2s
snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:21:02 +05:00

53 lines
2.8 KiB
TypeScript

import { parse } from '../src';
import { emoji, heading, link, mentionChannel, paragraph, plain } from './helpers';
test.each([
['# h1', [heading([plain('h1')], 1)]],
['# Hello', [heading([plain('Hello')], 1)]],
['# Rocket.Cat', [heading([link('//Rocket.Cat', [plain('Rocket.Cat')])], 1)]],
['# Hi', [heading([plain('Hi')], 1)]],
['# Hello this is dog', [heading([plain('Hello this is dog')], 1)]],
['# Rocket cat says Hello', [heading([plain('Rocket cat says Hello')], 1)]],
['# He said Hello to her', [heading([plain('He said Hello to her')], 1)]],
['#Hello', [paragraph([mentionChannel('Hello')])]],
['#Hello#', [paragraph([mentionChannel('Hello'), plain('#')])]],
['He#llo', [paragraph([plain('He#llo')])]],
['## Hello', [heading([plain('Hello')], 2)]],
['## Rocket.Cat', [heading([link('//Rocket.Cat', [plain('Rocket.Cat')])], 2)]],
['## Hi', [heading([plain('Hi')], 2)]],
['## Hello this is dog', [heading([plain('Hello this is dog')], 2)]],
['## Rocket cat says Hello', [heading([plain('Rocket cat says Hello')], 2)]],
['## He said Hello to her', [heading([plain('He said Hello to her')], 2)]],
['##Hello', [paragraph([plain('##Hello')])]],
['##Hello##', [paragraph([plain('##Hello##')])]],
['He##llo', [paragraph([plain('He##llo')])]],
['### Hello', [heading([plain('Hello')], 3)]],
['### Rocket.Cat', [heading([link('//Rocket.Cat', [plain('Rocket.Cat')])], 3)]],
['### Hi', [heading([plain('Hi')], 3)]],
['### Hello this is dog', [heading([plain('Hello this is dog')], 3)]],
['### Rocket cat says Hello', [heading([plain('Rocket cat says Hello')], 3)]],
['### He said Hello to her', [heading([plain('He said Hello to her')], 3)]],
['###Hello', [paragraph([plain('###Hello')])]],
['###Hello###', [paragraph([plain('###Hello###')])]],
['He###llo', [paragraph([plain('He###llo')])]],
['#### Hello', [heading([plain('Hello')], 4)]],
['#### Rocket.Cat', [heading([link('//Rocket.Cat', [plain('Rocket.Cat')])], 4)]],
['#### Hi', [heading([plain('Hi')], 4)]],
['#### Hello this is dog', [heading([plain('Hello this is dog')], 4)]],
['#### Rocket cat says Hello', [heading([plain('Rocket cat says Hello')], 4)]],
['#### He said Hello to her', [heading([plain('He said Hello to her')], 4)]],
['####Hello', [paragraph([plain('####Hello')])]],
['####Hello####', [paragraph([plain('####Hello####')])]],
['He####llo', [paragraph([plain('He####llo')])]],
['# Hello\n', [heading([plain('Hello')], 1)]],
['# # Hello\n', [heading([plain('# Hello')], 1)]],
['# :newspaper: Headline', [heading([emoji('newspaper'), plain(' Headline')], 1)]],
['## Hello :smile:', [heading([plain('Hello '), emoji('smile')], 2)]],
['### :smile: text :newspaper:', [heading([emoji('smile'), plain(' text '), emoji('newspaper')], 3)]],
])('parses %p', (input, output) => {
expect(parse(input)).toEqual(output);
});