forked from nyaruka/floweditor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v1.14.3' into update/v1.14.3
v1.14.3
- Loading branch information
Showing
25 changed files
with
379 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { v4 as generateUUID } from 'uuid'; | ||
|
||
import { respond } from './utils/index.js'; | ||
const topics = { | ||
next: null, | ||
previous: null, | ||
results: [ | ||
{ | ||
uuid: '6f38eba0-d673-4a35-82df-21bae2b6d466', | ||
name: 'General', | ||
created_on: '2021-09-01T01:06:39.178493Z' | ||
} | ||
] | ||
}; | ||
|
||
exports.handler = (request, context, callback) => { | ||
if (request.httpMethod === 'POST') { | ||
const body = JSON.parse(request.body); | ||
respond(callback, { | ||
uuid: generateUUID(), | ||
name: body.name, | ||
query: null, | ||
status: 'ready', | ||
count: 0 | ||
}); | ||
} else { | ||
respond(callback, topics); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { v4 as generateUUID } from 'uuid'; | ||
|
||
import { respond } from './utils/index.js'; | ||
const users = { | ||
next: null, | ||
previous: null, | ||
results: [ | ||
{ | ||
email: '[email protected]', | ||
first_name: 'Agent', | ||
last_name: 'User', | ||
role: 'agent', | ||
created_on: '2021-06-10T21:44:30.971221Z' | ||
}, | ||
{ | ||
email: '[email protected]', | ||
first_name: 'Viewer', | ||
last_name: 'User', | ||
role: 'viewer', | ||
created_on: '2020-11-09T23:02:10.095493Z' | ||
}, | ||
{ | ||
email: '[email protected]', | ||
first_name: 'Admin', | ||
last_name: 'User', | ||
role: 'administrator', | ||
created_on: '2020-08-18T19:07:08.984182Z' | ||
} | ||
] | ||
}; | ||
|
||
exports.handler = (request, context, callback) => { | ||
if (request.httpMethod === 'POST') { | ||
const body = JSON.parse(request.body); | ||
respond(callback, { | ||
uuid: generateUUID(), | ||
name: body.name, | ||
query: null, | ||
status: 'ready', | ||
count: 0 | ||
}); | ||
} else { | ||
respond(callback, users); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import { render, fireEvent, fireChangeText, fireTembaSelect } from 'test/utils'; | |
|
||
mock(utils, 'createUUID', utils.seededUUIDs()); | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion | ||
const ticketForm = getRouterFormProps({ | ||
node: createOpenTicketNode('Need help', 'Where are my cookies'), | ||
ui: { type: Types.split_by_ticket } | ||
|
@@ -30,17 +31,28 @@ describe(TicketRouterForm.name, () => { | |
expect(baseElement).toMatchSnapshot(); | ||
|
||
const okButton = getByText('Ok'); | ||
const subject = getByTestId('Subject'); | ||
const resultName = getByTestId('Result Name'); | ||
|
||
// our ticketer, subject, body and result name are required | ||
fireChangeText(subject, ''); | ||
// our ticketer, body and result name are required | ||
fireChangeText(resultName, ''); | ||
fireEvent.click(okButton); | ||
expect(ticketForm.updateRouter).not.toBeCalled(); | ||
|
||
// set our subject and result name | ||
fireChangeText(subject, 'Need help'); | ||
// we need a topic | ||
fireTembaSelect(getByTestId('temba_select_assignee'), { | ||
email: '[email protected]', | ||
first_name: 'Agent', | ||
last_name: 'User', | ||
role: 'agent', | ||
created_on: '2021-06-10T21:44:30.971221Z' | ||
}); | ||
|
||
// we need a topic | ||
fireTembaSelect(getByTestId('temba_select_topic'), { | ||
name: 'General', | ||
uuid: '6f38eba0-d673-4a35-82df-21bae2b6d466' | ||
}); | ||
|
||
fireChangeText(resultName, 'My Ticket Result'); | ||
|
||
fireEvent.click(okButton); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.