-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73a798d
commit 383a625
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { expect } from '@jest/globals'; | ||
import { goqZipCode } from '../goqZipCode'; | ||
import { checkLength } from '.'; | ||
|
||
describe('郵便番号が期待する桁数かチェック', () => { | ||
test('完全一致検索で入力データが7文字ならtrueを返す', () => { | ||
expect(goqZipCode.checkLength(true, 7)).toBe(true); | ||
expect(checkLength(true, 7)).toBe(true); | ||
}); | ||
|
||
test('完全一致検索で入力データが7文字以外ならfalseを返す', () => { | ||
expect(goqZipCode.checkLength(true, 8)).toBe(false); | ||
expect(checkLength(true, 8)).toBe(false); | ||
}); | ||
|
||
test('部分一致検索で入力データが2文字以上ならtrueを返す', () => { | ||
expect(goqZipCode.checkLength(false, 2)).toBe(true); | ||
expect(checkLength(false, 2)).toBe(true); | ||
}); | ||
|
||
test('部分一致検索で入力データが1文字以下の場合はfalseを返す', () => { | ||
expect(goqZipCode.checkLength(false, 1)).toBe(false); | ||
expect(checkLength(false, 1)).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { expect } from '@jest/globals'; | ||
import { goqZipCode } from '../goqZipCode'; | ||
import { convertHyphenatedZipCode } from './'; | ||
|
||
test('郵便番号にハイフンを追加', () => { | ||
expect(goqZipCode.convertHyphenatedZipCode('7340001')).toBe('734-0001'); | ||
expect(convertHyphenatedZipCode('7340001')).toBe('734-0001'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters