Files
iNaturalistReactNative/tests/factories/RemoteObservation.js
Ryan Stelly b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00

30 lines
952 B
JavaScript

import { define } from "factoria";
import userFactory from "./RemoteUser";
export default define( "RemoteObservation", faker => {
const dateObserved = faker.date.past( );
const dateCreated = faker.date.between( { from: dateObserved, to: new Date() } );
const dateUpdated = faker.date.between( { from: dateCreated, to: new Date() } );
return {
created_at: dateCreated.toISOString(),
id: faker.number.int( ),
uuid: faker.string.uuid( ),
geojson: {
coordinates: [
Number( faker.location.longitude( ) ),
Number( faker.location.latitude( ) ),
],
},
positional_accuracy: 10,
observed_on_string: [
dateObserved.getFullYear(),
`0${dateObserved.getMonth() + 1}`.slice( -2 ),
`0${dateObserved.getDate()}`.slice( -2 ),
].join( "-" ),
time_observed_at: dateObserved.toISOString(),
update_at: dateUpdated.toISOString(),
user: userFactory( "RemoteUser" ),
};
} );