Skip to content

Commit

Permalink
🐛 category lang hash lang #16
Browse files Browse the repository at this point in the history
  • Loading branch information
kenu committed Apr 17, 2024
1 parent f3cbcb8 commit 655674c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions tests/uri.test.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import util from '../web/utils/uri'

test('base URI', () => {
const category = 'dev'
const lang = 'ko'
const uri = util.getUri(category, lang)
const uri = util.getUri('dev', 'ko')
expect(uri).toBe('/')
})

test('category URI', () => {
const category = 'food'
const lang = 'ko'
const uri = util.getUri(category, lang)
const uri = util.getUri('food', 'ko')
expect(uri).toBe('/food/')
})

test('lang URI', () => {
const category = 'dev'
const lang = 'en'
const uri = util.getUri(category, lang)
const uri = util.getUri('dev', 'en')
expect(uri).toBe('/en')
})
2 changes: 1 addition & 1 deletion web/utils/uri.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function getUri(category = 'dev', lang) {
function getUri(category = 'dev', lang = '') {
if (category === 'dev') {
category = ''
}
Expand Down

0 comments on commit 655674c

Please sign in to comment.