You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
785 B

import { describe, expect, it } from 'vitest'
import { shouldSkipMachineTranslatePlainCore } from '@/lib/translate-client'
describe('shouldSkipMachineTranslatePlainCore', () => {
it('returns true for one or more ASCII hashtags with spaces', () => {
expect(shouldSkipMachineTranslatePlainCore('#meme #memes #memestr #plebchain')).toBe(true)
expect(shouldSkipMachineTranslatePlainCore(' #a #b ')).toBe(true)
})
it('returns false when there is non-hashtag prose', () => {
expect(shouldSkipMachineTranslatePlainCore('#meme is cool')).toBe(false)
expect(shouldSkipMachineTranslatePlainCore('see #meme')).toBe(false)
})
it('returns true for unicode hashtag letters', () => {
expect(shouldSkipMachineTranslatePlainCore('#café #naïve')).toBe(true)
})
})