Skip to content

Commit

Permalink
add importDate, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomás Ciccola committed Jul 29, 2024
1 parent bdf5831 commit aac086c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion proto/projectSettings/v1.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ message ProjectSettings_1 {
message ConfigMetadata {
optional string name = 1;
optional google.protobuf.Timestamp buildDate = 2;
optional int32 fileVersion = 3;
optional google.protobuf.Timestamp importDate = 3;
optional int32 fileVersion = 4;
}

optional DefaultPresets defaultPresets = 2;
Expand Down
5 changes: 5 additions & 0 deletions schema/projectSettings/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
"format": "date-time",
"description": "RFC3339-formatted datetime of when the configuration was built"
},
"importDate": {
"type": "string",
"format": "date-time",
"description": "RFC3339-formatted datetime of when the configuration was imported to the project"
},
"fileVersion": {
"type": "number",
"minimum": 0,
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/cached.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ export const cachedValues = {
fieldIds: [randomBytes(32).toString('hex')],
iconId: randomBytes(32).toString('hex'),
docIdRef: randomBytes(32).toString('hex'),
configMetadata: {
buildDate: date,
importDate: date,
},
}
7 changes: 5 additions & 2 deletions test/fixtures/good-docs-completed.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ export const goodDocsCompleted = [
relation: cachedValues.defaultPresets.point,
},
name: 'myProject',
configName: 'mapeo-config',
configVersion: '1.0.0',
configMetadata: {
name: 'mapeo-config-1',
buildDate: cachedValues.configMetadata.buildDate,
importDate: cachedValues.configMetadata.importDate,
},
deleted: false,
},
expected: {},
Expand Down
7 changes: 5 additions & 2 deletions test/fixtures/good-docs-minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ export const goodDocsMinimal = [
createdAt: cachedValues.createdAt,
updatedAt: cachedValues.updatedAt,
createdBy: cachedValues.createdBy,
configName: 'mapeo-config',
configVersion: '1.0.0',
configMetadata: {
name: 'mapeo-config',
buildDate: cachedValues.configMetadata.buildDate,
importDate: cachedValues.configMetadata.importDate,
},
links: [],
deleted: false,
},
Expand Down

0 comments on commit aac086c

Please sign in to comment.