Merged PR 691: ライセンス自動割り当てのテストコードの結果が異常になる
## 概要 [Task3486: ライセンス自動割り当てのテストコードの結果が異常になる](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3486) 現在時刻と明示的に定義した日付の比較を行っていたことで、年を跨ぎ異常となっていた ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認、develop環境で確認など ## 補足 - 相談、参考資料などがあれば
This commit is contained in:
parent
6b1020be8f
commit
658de1c1ae
@ -282,13 +282,9 @@ describe("licenseAutoAllocation", () => {
|
||||
it("有効期限が指定日のライセンスが自動更新されること(リトライ用)", async () => {
|
||||
if (!source) fail();
|
||||
const context = new InvocationContext();
|
||||
// 11/22の日付を作成
|
||||
const dateSeptember22 = new Date();
|
||||
dateSeptember22.setMonth(11);
|
||||
dateSeptember22.setDate(22);
|
||||
dateSeptember22.setHours(23, 59, 59);
|
||||
const currentDateEndTime = new DateWithDayEndTime(dateSeptember22);
|
||||
|
||||
// 2023/11/22の日付を作成
|
||||
const date1122 = new Date(2023, 10, 22, 23, 59, 59);
|
||||
const currentDateEndTime = new DateWithDayEndTime(date1122);
|
||||
// アカウント
|
||||
const account1 = await makeTestAccount(
|
||||
source,
|
||||
@ -328,7 +324,7 @@ describe("licenseAutoAllocation", () => {
|
||||
auto_renew: false,
|
||||
});
|
||||
|
||||
// 割り当て済みで有効期限が12/31のライセンス
|
||||
// 割り当て済みで有効期限が11/22のライセンス
|
||||
await createLicense(
|
||||
source,
|
||||
1,
|
||||
@ -389,10 +385,9 @@ describe("licenseAutoAllocation", () => {
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
||||
// 割り当て済みの更新対象ではないライセンス
|
||||
const nextDate = new Date();
|
||||
nextDate.setDate(dateSeptember22.getDate() + 1);
|
||||
nextDate.setDate(date1122.getDate() + 1);
|
||||
nextDate.setHours(23, 59, 59); // 時分秒を"23:59:59"に固定
|
||||
nextDate.setMilliseconds(0);
|
||||
await createLicense(
|
||||
@ -407,15 +402,13 @@ describe("licenseAutoAllocation", () => {
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
||||
// 有効期限が先の未割当ライセンスを作成
|
||||
// idが100のものは有効期限が当日なので自動割り当て対象外
|
||||
// idが101のものから割り当てられる
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const date = new Date();
|
||||
date.setDate(dateSeptember22.getDate() + i);
|
||||
date.setHours(23, 59, 59); // 時分秒を"23:59:59"に固定
|
||||
date.setMilliseconds(0);
|
||||
// 2023/11/22の日付を作成
|
||||
const date = new Date(2023, 10, 22, 23, 59, 59);
|
||||
date.setDate(date.getDate() + i);
|
||||
await createLicense(
|
||||
source,
|
||||
i + 100,
|
||||
@ -446,8 +439,7 @@ describe("licenseAutoAllocation", () => {
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
||||
await licenseAutoAllocationProcessing(context, source, dateSeptember22);
|
||||
await licenseAutoAllocationProcessing(context, source, date1122);
|
||||
const user1Allocated = await selectLicenseByAllocatedUser(source, user1.id);
|
||||
const user2Allocated = await selectLicenseByAllocatedUser(source, user2.id);
|
||||
const user3Allocated = await selectLicenseByAllocatedUser(source, user3.id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user