This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/cypress/component/components/Emoji/isStringWithOnlyOneEmoji.cy.ts

19 lines
768 B
TypeScript

import { isStringWithOnlyOneEmoji } from "../../../../components/Emoji/isStringWithOnlyOneEmoji"
describe("components/Emoji/isStringWithOnlyOneEmoji", () => {
it("returns true with a string with only one emoji", () => {
expect(isStringWithOnlyOneEmoji(":wave:")).equal(true)
expect(isStringWithOnlyOneEmoji(":smile:")).equal(true)
})
it("returns false with a string with multiple emoji or with text", () => {
expect(isStringWithOnlyOneEmoji(":wave: :smile:")).equal(false)
expect(isStringWithOnlyOneEmoji(":wave: some text")).equal(false)
expect(isStringWithOnlyOneEmoji("some text :wave:")).equal(false)
})
it("returns false with a string without emoji", () => {
expect(isStringWithOnlyOneEmoji("some text")).equal(false)
})
})