Skip to content
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

Update node js and fix failing unit tests #1119

Merged
merged 8 commits into from
Oct 18, 2022
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: node_js
git:
depth: 1
node_js:
- "14"
- "16"

cache:
npm: false # disable npm cache for npm ci
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
time \
vim \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
Expand Down
3 changes: 3 additions & 0 deletions src/Submission/MapDataModel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ class MapDataModel extends React.Component {
if (data && data[this.state.parentNodeType]) {
this.setState((prevState) => ({ validParentIds: data[prevState.parentNodeType] }));
}
}).catch(error => {
// TODO - should we throw this error?
pieterlukasse marked this conversation as resolved.
Show resolved Hide resolved
console.error(error);
});
} else {
this.setState({ validParentIds: [] });
Expand Down
5 changes: 3 additions & 2 deletions src/UserProfile/UserProfile.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('the UserProfile component', () => {
/>
</StaticRouter>,
);
expect($vdom.find('tbody tr')).toHaveLength(testProps.userProfile.jtis.length + 1);
// we expect one delete button per jti:
expect($vdom.find(`button[name="${DELETE_BTN}"]`)).toHaveLength(testProps.userProfile.jtis.length);
});

it('triggers create-key events', (done) => {
Expand Down Expand Up @@ -79,7 +80,7 @@ describe('the UserProfile component', () => {
</StaticRouter>,
);
const $deleteBtn = $vdom.find(`button[name="${DELETE_BTN}"]`);
expect($deleteBtn).toHaveLength(2);
expect($deleteBtn).toHaveLength(testProps.userProfile.jtis.length);
$deleteBtn.at(0).simulate('click');
// should invoke onRequestDeleteKey callback (above - calls done()) ...
});
Expand Down