Ignore hashtags when sorting channels

This commit is contained in:
Ken-Håvard Lieng 2020-06-19 03:54:19 +02:00
parent fc937aaac8
commit 4694e66e98
4 changed files with 96 additions and 72 deletions

View file

@ -1,10 +1,24 @@
import React from 'react';
import TestRenderer from 'react-test-renderer';
import { isChannel, isValidNick, isValidChannel, isValidUsername } from '..';
import {
trimPrefixChar,
isChannel,
isValidNick,
isValidChannel,
isValidUsername
} from '..';
import linkify from '../linkify';
const render = el => TestRenderer.create(el).toJSON();
describe('trimPrefixChar()', () => {
it('trims prefix characters', () => {
expect(trimPrefixChar('##chan', '#')).toBe('chan');
expect(trimPrefixChar('#chan', '#')).toBe('chan');
expect(trimPrefixChar('chan', '#')).toBe('chan');
});
});
describe('isChannel()', () => {
it('it handles strings', () => {
expect(isChannel('#cake')).toBe(true);