Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducica committed Jan 18, 2025
1 parent 713e9d3 commit a014fb1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion oarepo_requests/ui/components/custom_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def form_config(
form: dict | list = getattr(type_, "form", None) # type: ignore
if not form:
return

if isinstance(form, dict):
# it is just a single field
form = [{"section": "", "fields": [form]}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export const RequestCustomFields = ({
// Only applies to RequestModalContent component:
// READ ONLY modal type contains Accept, Decline, and/or Cancel actions OR contains Cancel action only => only ReadOnlyCustomFields are rendered
// SUBMIT FORM modal type contains Submit and/or Save, Create, CreateAndSubmit action => Form is rendered
const customFieldsType =
request.status_code === "created"
? REQUEST_MODAL_TYPE.SUBMIT_FORM
: REQUEST_MODAL_TYPE.READ_ONLY;
const customFieldsType = actions.some(
({ name }) => name === REQUEST_TYPE.ACCEPT || name === REQUEST_TYPE.CANCEL
)
? REQUEST_MODAL_TYPE.READ_ONLY
: REQUEST_MODAL_TYPE.SUBMIT_FORM;

const renderSubmitForm =
customFieldsType === REQUEST_MODAL_TYPE.SUBMIT_FORM &&
Expand Down
9 changes: 5 additions & 4 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ PYTHON="${PYTHON:-python3.12}"

MODEL="thesis"

export PIP_EXTRA_INDEX_URL=https://gitlab.cesnet.cz/api/v4/projects/1408/packages/pypi/simple
export UV_EXTRA_INDEX_URL=https://gitlab.cesnet.cz/api/v4/projects/1408/packages/pypi/simple

BUILDER_VENV=.venv-builder
BUILD_TEST_DIR="tests"
CODE_TEST_DIR="tests"

curl -L -o forked_install.sh https://github.com/oarepo/nrp-devtools/raw/main/tests/forked_install.sh

if test -d $BUILDER_VENV ; then
rm -rf $BUILDER_VENV
Expand Down Expand Up @@ -53,10 +55,9 @@ find oarepo_requests -name '*.py' | grep -v '__init__.py' | sed 's/.py$//' | tr
done | python

# now install the tests (might bring more dependencies, that's why we have checked the imports before)

pip install -e ".[tests]"
pip install "oarepo[tests, rdm]==${OAREPO_VERSION}.*"

sh forked_install.sh invenio-records-resources
sh forked_install.sh invenio-requests
sh forked_install.sh invenio-drafts-resources
pytest $BUILD_TEST_DIR/test_requests
pytest $BUILD_TEST_DIR/test_ui

0 comments on commit a014fb1

Please sign in to comment.