mirror of
https://github.com/hanzoai/Detox.git
synced 2026-09-24 16:55:12 +00:00
fix(sync): accept null one-time event objects (#4949)
This commit is contained in:
@@ -114,7 +114,10 @@
|
||||
"type":"string"
|
||||
},
|
||||
"object":{
|
||||
"type":"string"
|
||||
"type":[
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required":[
|
||||
|
||||
@@ -150,6 +150,23 @@ describe('Sync Status Formatter', () => {
|
||||
await expect(format(busyStatus)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should format "one_time_events" correctly when object is null', async () => {
|
||||
let busyStatus = {
|
||||
app_status: 'busy',
|
||||
busy_resources: [
|
||||
{
|
||||
name: 'one_time_events',
|
||||
description: {
|
||||
event: 'foo',
|
||||
object: null
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
await expect(format(busyStatus)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should format "one_time_events" correctly', async () => {
|
||||
let busyStatus = {
|
||||
app_status: 'busy',
|
||||
|
||||
@@ -176,6 +176,11 @@ exports[`Sync Status Formatter busy status should format "one_time_events" corre
|
||||
• The event "foo" is taking place with object: "bar"."
|
||||
`;
|
||||
|
||||
exports[`Sync Status Formatter busy status should format "one_time_events" correctly when object is null 1`] = `
|
||||
"The app is busy with the following tasks:
|
||||
• The event "foo" is taking place."
|
||||
`;
|
||||
|
||||
exports[`Sync Status Formatter busy status should format "one_time_events" correctly when there is no object 1`] = `
|
||||
"The app is busy with the following tasks:
|
||||
• The event "foo" is taking place."
|
||||
|
||||
@@ -3,6 +3,6 @@ const { makeResourceTitle } = require('./utils');
|
||||
module.exports = function(properties) {
|
||||
const objectName = properties.object;
|
||||
return makeResourceTitle(
|
||||
`The event "${properties.event}" is taking place${(objectName === undefined) ? `.` : ` with object: "${objectName}".`}`
|
||||
`The event "${properties.event}" is taking place${(objectName == null) ? `.` : ` with object: "${objectName}".`}`
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user