aboutsummaryrefslogtreecommitdiff
path: root/webAO/__tests__/encoding.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/__tests__/encoding.test.ts')
-rw-r--r--webAO/__tests__/encoding.test.ts39
1 files changed, 1 insertions, 38 deletions
diff --git a/webAO/__tests__/encoding.test.ts b/webAO/__tests__/encoding.test.ts
index 36f34cfc..aa1409a9 100644
--- a/webAO/__tests__/encoding.test.ts
+++ b/webAO/__tests__/encoding.test.ts
@@ -1,4 +1,4 @@
-import { escapeChat, unescapeChat, safeTags, decodeChat, prepChat } from '../encoding';
+import { escapeChat, unescapeChat } from '../encoding';
describe('encode/decode', () => {
it('should escape special characters correctly', () => {
@@ -13,40 +13,3 @@ describe('encode/decode', () => {
expect(unescapeChat(input)).toBe(expectedOutput);
});
});
-
-describe('safeTags', () => {
- it('should replace < with < and > with >', () => {
- const input = '<div>Hello</div>';
- const expectedOutput = '<div>Hello</div>';
- expect(safeTags(input)).toBe(expectedOutput);
- });
-
- it('should handle empty strings correctly', () => {
- expect(safeTags('')).toBe('');
- });
-});
-
-describe('decodeChat', () => {
- it('should decode escaped unicode characters', () => {
- const input = '\\u0041\\u0026\\u003F';
- const expectedOutput = 'A&?';
- expect(decodeChat(input)).toBe(expectedOutput);
- });
-
- it('should handle no unicode to decode', () => {
- const input = 'Hello World!';
- expect(decodeChat(input)).toBe(input);
- });
-});
-
-describe('prepChat', () => {
- it('should apply safeTags, unescapeChat and decodeChat correctly', () => {
- const input = '<num><and>A<percent>';
- const expectedOutput = '#&A%'; // Output after applying all functions in order
- expect(prepChat(input)).toBe(expectedOutput);
- });
-
- it('should handle empty strings correctly', () => {
- expect(prepChat('')).toBe('');
- });
-}); \ No newline at end of file