forked from openmrs/openmrs-esm-form-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore) Dependency upgrades and improvements to linting and types (op…
- Loading branch information
1 parent
14d3050
commit cd4e306
Showing
78 changed files
with
4,875 additions
and
3,534 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
**/dist/* | ||
**/node_modules/* | ||
**/*.d.tsx | ||
src/**/*.test.tsx | ||
**/*.d.tsx | ||
__mocks__/* |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn pretty-quick --staged | ||
yarn prettier && npx lint-staged | ||
yarn turbo extract-translations |
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,8 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"printWidth": 120, | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} |
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 |
---|---|---|
@@ -1,66 +1,60 @@ | ||
import { APIRequestContext, expect } from "@playwright/test"; | ||
import customSchema from "../support/custom-schema.json"; | ||
import type { APIRequestContext } from '@playwright/test'; | ||
import { expect } from '@playwright/test'; | ||
import customSchema from '../support/custom-schema.json'; | ||
import type { Form } from '../../src/types'; | ||
|
||
export const createForm = async ( | ||
api: APIRequestContext, | ||
isFormPublished: boolean | ||
) => { | ||
const formResponse = await api.post("form", { | ||
export const createForm = async (api: APIRequestContext, isFormPublished: boolean) => { | ||
const formResponse = await api.post('form', { | ||
data: { | ||
name: `A sample test form ${Math.floor(Math.random() * 10000)}`, | ||
version: "1.0", | ||
version: '1.0', | ||
published: isFormPublished, | ||
description: "This is the form description", | ||
description: 'This is the form description', | ||
encounterType: { | ||
uuid: "e22e39fd-7db2-45e7-80f1-60fa0d5a4378", | ||
uuid: 'e22e39fd-7db2-45e7-80f1-60fa0d5a4378', | ||
}, | ||
}, | ||
}); | ||
await expect(formResponse.ok()).toBeTruthy(); | ||
expect(formResponse.ok()).toBeTruthy(); | ||
const form = await formResponse.json(); | ||
|
||
return form; | ||
return form as Form; | ||
}; | ||
|
||
export const addFormResources = async ( | ||
api: APIRequestContext, | ||
valueReference: string, | ||
formUuid: string | ||
) => { | ||
export const addFormResources = async (api: APIRequestContext, valueReference: string, formUuid: string) => { | ||
const formResourcesRes = await api.post(`form/${formUuid}/resource`, { | ||
data: { | ||
name: "JSON schema", | ||
dataType: "AmpathJsonSchema", | ||
name: 'JSON schema', | ||
dataType: 'AmpathJsonSchema', | ||
valueReference: valueReference, | ||
}, | ||
}); | ||
await expect(formResourcesRes.ok()).toBeTruthy(); | ||
expect(formResourcesRes.ok()).toBeTruthy(); | ||
}; | ||
|
||
export const createValueReference = async (api: APIRequestContext) => { | ||
const boundary = | ||
"--------------------------" + Math.floor(Math.random() * 1e16); | ||
const delimiter = "\r\n--" + boundary + "\r\n"; | ||
const closeDelimiter = "\r\n--" + boundary + "--"; | ||
const boundary = '--------------------------' + Math.floor(Math.random() * 1e16); | ||
const delimiter = '\r\n--' + boundary + '\r\n'; | ||
const closeDelimiter = '\r\n--' + boundary + '--'; | ||
|
||
const body = | ||
delimiter + | ||
'Content-Disposition: form-data; name="file"; filename="schema.json"\r\n' + | ||
"Content-Type: application/json\r\n\r\n" + | ||
'Content-Type: application/json\r\n\r\n' + | ||
JSON.stringify(customSchema) + | ||
closeDelimiter; | ||
|
||
const valueReference = await api.post("clobdata", { | ||
const valueReference = await api.post('clobdata', { | ||
data: body, | ||
headers: { | ||
"Content-Type": "multipart/form-data; boundary=" + boundary, | ||
'Content-Type': 'multipart/form-data; boundary=' + boundary, | ||
}, | ||
}); | ||
await expect(valueReference.ok()).toBeTruthy(); | ||
expect(valueReference.ok()).toBeTruthy(); | ||
return await valueReference.text(); | ||
}; | ||
|
||
export async function deleteForm(api: APIRequestContext, uuid: string) { | ||
const formDeleteRes = await api.delete(`form/${uuid}`, { data: {} }); | ||
await expect(formDeleteRes.ok()).toBeTruthy(); | ||
expect(formDeleteRes.ok()).toBeTruthy(); | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./test"; | ||
export * from './test'; |
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.