first commit
This commit is contained in:
1 parent
18d31d5dcf
commit
77a5f5248c
31 files changed
+6637
-30
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { parseBranches, parsePriceOptions } from '../electron/main/reservation'
|
||||
|
||||
describe('reservation response parsers', () => {
|
||||
it('returns only public room branch fields', () => {
|
||||
const html = `<script>
|
||||
const originalZizumData = [
|
||||
{"num":22,"name":"STATION","phone":"010-4445-6082","category":"room","pass":"secret"},
|
||||
{"num":25,"name":"무비무드","phone":"010-0000-0000","category":"movie"}
|
||||
];
|
||||
</script>`
|
||||
|
||||
expect(parseBranches(html)).toEqual([
|
||||
{ num: 22, name: 'STATION', phone: '010-4445-6082' },
|
||||
])
|
||||
})
|
||||
|
||||
it('parses server-calculated per-person prices', () => {
|
||||
const html = `<select name="person" id="person">
|
||||
<option value='2' data-rev_price='60000' data-price='60000'>2명</option>
|
||||
<option value='4' data-rev_price='120000' data-price='120000'>4명</option>
|
||||
</select>`
|
||||
|
||||
expect(parsePriceOptions(html)).toEqual([
|
||||
{ person: 2, totalPrice: 60_000 },
|
||||
{ person: 4, totalPrice: 120_000 },
|
||||
])
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user