Skip to content

Commit

Permalink
chore: try fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KavithaSiva committed Jan 16, 2025
1 parent 59ae014 commit 500822c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/odata-v4/src/de-serializers/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function serializeToDateTimeOffset(
const precisionFormat = new Array(precision).fill('S').join('');
return value.utc().format(`YYYY-MM-DDTHH:mm:ss.${precisionFormat}`) + 'Z';
}
// If no precision, return without decimal places
// If precision is undefined, default to 0
return value.utc().format('YYYY-MM-DDTHH:mm:ss') + 'Z';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function createTestEntity() {
.keyPropertyGuid(keyPropGuid)
.keyPropertyString(keyPropString)
.keyDateProperty(keyPropDate)
.dateTimeOffSetProperty(moment())
.int32Property(int32Prop)
.build();
}
Expand Down
3 changes: 2 additions & 1 deletion test-packages/e2e-tests/test/request-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ async function createEntity(key: number) {
.stringProperty('someValue')
.dateProperty(moment(0))
.timeOfDayProperty({ hours: 1, minutes: 2, seconds: 3 })
.dataTimeOffsetDataTimeProperty(moment(0))
.dataTimeOffsetDataTimeProperty(moment(0)) // has an undefined precision
.dataTimeOffsetTimestampProperty(moment(0)) // has precision set to 7
.build();
return requestBuilder.create(dataForCreation).execute(destination);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ export class TestEntityApi<
DECIMAL_PROPERTY: fieldBuilder.buildEdmTypeField(
'DecimalProperty',
'Edm.Decimal',
true
true,
5
),
/**
* Static representation of the {@link singleProperty} property for query construction.
Expand Down Expand Up @@ -409,7 +410,8 @@ export class TestEntityApi<
TIME_PROPERTY: fieldBuilder.buildEdmTypeField(
'TimeProperty',
'Edm.Time',
true
true,
0
),
/**
* Static representation of the {@link dateTimeProperty} property for query construction.
Expand All @@ -418,7 +420,8 @@ export class TestEntityApi<
DATE_TIME_PROPERTY: fieldBuilder.buildEdmTypeField(
'DateTimeProperty',
'Edm.DateTime',
true
true,
0
),
/**
* Static representation of the {@link dateTimeOffSetProperty} property for query construction.
Expand All @@ -427,7 +430,8 @@ export class TestEntityApi<
DATE_TIME_OFF_SET_PROPERTY: fieldBuilder.buildEdmTypeField(
'DateTimeOffSetProperty',
'Edm.DateTimeOffset',
true
true,
0
),
/**
* Static representation of the {@link byteProperty} property for query construction.
Expand Down

0 comments on commit 500822c

Please sign in to comment.