Skip to content
Snippets Groups Projects
Commit c270c7a5 authored by Sofiya Tepikin's avatar Sofiya Tepikin
Browse files

Add tests to the getOrdinalSuffix function

parent f9eb06f1
No related branches found
No related tags found
No related merge requests found
import { expect } from 'chai'
import {getOrdinalSuffix } from '../components/helpers/home'
describe('Home helper: getOrdinalSuffix', () => {
it('For 1, it returns suffix \'st\'', () => {
expect(getOrdinalSuffix(1)).to.eql('st')
})
it('For 2, it returns suffix \'nd\'', () => {
expect(getOrdinalSuffix(2)).to.eql('nd')
})
it('For 3, it returns suffix \'rd\'', () => {
expect(getOrdinalSuffix(3)).to.eql('rd')
})
it('For 11, it returns suffix \'th\'', () => {
expect(getOrdinalSuffix(11)).to.eql('th')
})
it('For 23, it returns suffix \'rd\'', () => {
expect(getOrdinalSuffix(23)).to.eql('rd')
})
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment