diff --git a/src/UnifiedViews-tests/ScheduleCreate.test.js b/src/UnifiedViews-tests/ScheduleCreate.test.js new file mode 100644 index 000000000..5c72855de --- /dev/null +++ b/src/UnifiedViews-tests/ScheduleCreate.test.js @@ -0,0 +1,52 @@ +describe('Pipeline Schedule Creating Test for UnifiedViews', function() { + const server_URL = 'http://82.202.226.30:80'; + const prefix = '/master/api/1/pipelines'; + const access = '?userExternalId=admin'; + const prefix_2 = '/master/api/1/pipelines/?userExternalId=admin'; + const props = ['name', 'description']; + + var username = 'master'; + var password = 'commander'; + var headers = new Headers(); + var pipeline; + var schedule; + headers.append('Authorization', 'Basic ' + btoa(username + ':' + password)); + headers.append('Content-Type', 'application/json'); + + + + + it('schedule creation test', async () => { + const scheduleData = { + id: 1, + enabled: true, + firstExecution: '2020-02-05T18:00:51.001+0000', + userExternalId: 'admin', + }; + console.log(scheduleData); + + // Create new schedule + schedule = await fetch(server_URL.concat(prefix, '/', 1, '/schedules'), { + method: 'POST', + headers: headers, + body: JSON.stringify(scheduleData), + }).then((r) => r.json()); + + console.log(schedule); + const newSchedule = schedule.map((binding) => ({ + id: binding.pipeline.value, + enabled: binding.enabled.value, + firstExecution: binding.firstExecution.value, + })); + //Check if created schedule has correct data + expect(newSchedule).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + id: scheduleData.id.value, + enabled: scheduleData.enabled.value, + firstExecution: scheduleData.firstExecution.value, + }), + ]), + ); + }, 30000); +}); \ No newline at end of file diff --git a/src/components/CreateRequirements2.stories.js b/src/components/CreateRequirements2.stories.js new file mode 100644 index 000000000..9044b44e0 --- /dev/null +++ b/src/components/CreateRequirements2.stories.js @@ -0,0 +1,136 @@ +import { + Form, Input, Button, Radio, Select, Typography, Upload, Icon, Checkbox +} from 'antd'; +import React from "react"; +import ReactDOM from "react-dom"; +import { DatePicker, message } from "antd"; +import "antd/dist/antd.css"; +import "./index.css"; +import { storiesOf } from '@storybook/react'; + +const Option = Select.Option; +function handleChange(value) { + console.log(`selected ${value}`); +} + +class FormLayoutDemo extends React.Component { + constructor() { + super(); + this.state = { + formLayout: 'horizontal', + }; + } + + handleFormLayoutChange = (e) => { + this.setState({ formLayout: e.target.value }); + } + + + + + render() { + const { formLayout } = this.state; + const formItemLayout = formLayout === 'horizontal' ? { + labelCol: { span: 4 }, + wrapperCol: { span: 9 }, + } : null; + const formItem2Layout = formLayout === 'horizontal' ? { + labelCol: { span: 7 }, + wrapperCol: { span: 2 }, + } : null; + const buttonItemLayout = formLayout === 'horizontal' ? { + wrapperCol: { span: 14, offset: 4 }, + } : null; + + + return ( +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Открыть требование + +
+
+ ); + } +} + + + +storiesOf("LR1", module) + .add("CreateRequirements", () => ( +

+ Form +

+ )); +