Skip to content

Commit

Permalink
1.unit test
Browse files Browse the repository at this point in the history
2.add node end action do not valid form
  • Loading branch information
blackholll committed Nov 14, 2021
1 parent 033e623 commit d5fec70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions frontend/src/pages/Ticket/TicketDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class TicketDetail extends Component<TicketDetailProps, TicketDetailState> {
const result = await addNodeTicketRequest(this.props.ticketId, values);
if(result.code === 0) {
message.success('加签成功');
this.setState({isDeliverModalVisible: false});
this.setState({isAddNodeModalVisible: false});
this.fetchTicketDetailInfo();
this.fetchTicketTransitionInfo();
}
Expand Down Expand Up @@ -731,9 +731,10 @@ class TicketDetail extends Component<TicketDetailProps, TicketDetailState> {

addNodeEndTicket = async(ticketId: number) =>{
//加签完成
const values = await this.formRef.current.validateFields();
// const values = await this.formRef.current.validateFields();
const suggestion = await this.formRef.current.getFieldValue('suggestion');

const result = await addNodeEndTicketRequest(ticketId, {suggestion: values['suggestion']});
const result = await addNodeEndTicketRequest(ticketId, {suggestion: suggestion});
if (result.code === 0) {
this.fetchTicketDetailInfo();
this.fetchTicketTransitionInfo();
Expand Down
4 changes: 2 additions & 2 deletions tests/test_views/test_account_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ def test_update_app_token(self):
"""
c = Client()
c.login(**dict(username='admin', password='123456'))
app_token_dict = dict(app_name='yunwei_new', ticket_sn_prefix='yunweinew', workflow_ids='2')
app_token_dict = dict(ticket_sn_prefix='yunweinew', workflow_ids='2')
response_content = c.patch('/api/v1.0/accounts/app_token/4', data=json.dumps(app_token_dict),
content_type='application/json').content
response_content_dict = json.loads(str(response_content, encoding='utf-8'))
print(response_content_dict)
self.assertEqual(response_content_dict.get('code'), 0)

new_response_content = c.get('/api/v1.0/accounts/app_token', content_type='application/json').content
response_content_dict = json.loads(str(new_response_content, encoding='utf-8'))
result = response_content_dict['data']['value']
for result0 in result:
if result0['id'] == 4:
self.assertEqual(result0['app_name'], 'yunwei_new')
self.assertEqual(result0['ticket_sn_prefix'], 'yunweinew')
self.assertEqual(result0['workflow_ids'], '2')

0 comments on commit d5fec70

Please sign in to comment.