Skip to content

Add target.files attribute to events for file type input elements #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ on:
- cron: "0 0 * * *"

jobs:
test-coverage:
test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nanasess/setup-chromedriver@master
- uses: actions/setup-node@v2-beta
with:
node-version: "12"
node-version: "14"
- name: Use Latest Python
uses: actions/setup-python@v2
with:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Run Tests
run: |
nox -s test -- pytest[--headless]
matrix:
test-python-versions:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: nanasess/setup-chromedriver@master
- uses: actions/setup-node@v2-beta
with:
node-version: "12"
node-version: "14"
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -49,3 +49,17 @@ jobs:
- name: Run Tests
run: |
nox -s test -- pytest[--headless,--no-cov]
test-javascript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Test Javascript
working-directory: ./src/idom/client/app
run: |
npm --version
npm install -g npm@v7.13.0
npm install
npm test
64 changes: 54 additions & 10 deletions docs/source/developer-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Developer Guide

This project uses the `GitHub Flow`_ (more detail :ref:`below <Making a Pull Request>`)
for collaboration and consists primarily of Python code and Javascript code. A variety
of tools are used to aid in its development. Below is a short list of the tools which
will be most commonly referenced in the sections to follow:
of tools are used to aid in its development. Below is a brief list of the most commonly
used tools:

.. list-table::
:header-rows: 1
Expand Down Expand Up @@ -75,16 +75,38 @@ about how to get started. To make a change to IDOM you'll do the following:
Development Environment
-----------------------

If you've already :ref:
In order to work with IDOM's source code you'll need to install Git_ (or `Git Bash`_ on
Windows). Once done you can clone a local copy of this repository:
In order to develop IDOM locally you'll first need to install the following:

.. list-table::
:header-rows: 1

* - What to Install
- How to Install

* - Git_
- https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

* - Python_ >= 3.7
- https://realpython.com/installing-python/

* - NodeJS >= 14
- https://nodejs.org/en/download/package-manager/

* - NPM >= 7.7
- https://docs.npmjs.com/try-the-latest-stable-version-of-npm

.. note::

NodeJS distributes a version of NPM, but you'll want to get the latest

Once done, you can clone a local copy of this repository:

.. code-block:: bash

git clone https://github.com/idom-team/idom.git
cd idom

At this point you should be able to run the command below to:
Then, you should be able to run the command below to:

- Install an editable version of the Python code

Expand All @@ -102,20 +124,26 @@ If you modify any Javascript, you'll need to re-install IDOM:

pip install -e .

However you may also ``cd`` to the ``idom/client/app`` directory which contains a
However you may also ``cd`` to the ``src/idom/client/app`` directory which contains a
``package.json`` that you can use to run standard ``npm`` commands from.


Running The Tests
-----------------

The test suite for IDOM is executed using Nox_ and covers:
The test suite for IDOM uses Nox_ and NPM_ in order to validate:

1. Server-side Python code with PyTest_

2. The end-to-end application using Selenium_
2. The end-to-end application using Selenium_ in Python

3. Client-side Javascript code with UVU_


To run the full suite of tests you'll need to install:
Running Python Tests
....................

To run the full suite of Python tests you'll need to install:

- `Google Chrome`_

Expand Down Expand Up @@ -145,6 +173,21 @@ You can pass other options to pytest in a similar manner:
nox -s test -- pytest[arg,--flag,--key=value]


Running Javascript Tests
........................

If you've already run ``npm install`` inside the ``src/idom/client/app`` directory, you
can execute the suite of workspace tests under ``packages/*`` with:

.. code-block::

npm test

As a final check, you might want to run ``npm run build``. This command is run in the
top-level ``setup.py`` installation script for the Python package, so if this command
fails, the installation of the Python package with ``pip`` will too.


Code Quality Checks
-------------------

Expand Down Expand Up @@ -247,3 +290,4 @@ to their respective documentation in the links below
.. _Black: https://github.com/psf/black
.. _Flake8: https://flake8.pycqa.org/en/latest/
.. _ISort: https://pycqa.github.io/isort/
.. _UVU: https://github.com/lukeed/uvu
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ def docs_in_docker(session: Session) -> None:
def test(session: Session) -> None:
"""Run the complete test suite"""
session.install("--upgrade", "pip", "setuptools", "wheel")
test_python(session)
test_suite(session)
test_types(session)
test_style(session)
test_docs(session)


@nox.session
def test_python(session: Session) -> None:
def test_suite(session: Session) -> None:
"""Run the Python-based test suite"""
session.env["IDOM_DEBUG_MODE"] = "1"
install_requirements_file(session, "test-env")
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading