-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into gh-461-test-upload-status-and-review
- Loading branch information
Showing
25 changed files
with
5,809 additions
and
102 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Database Initializer Integration Tests | ||
|
||
concurrency: | ||
group: ${{ github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- "develop" | ||
- "master" | ||
- "main" | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
env: | ||
OPENSUSE_UNOFFICIAL_LIBCONTAINERS_KEY_URL: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/Release.key" | ||
OPENSUSE_UNOFFICIAL_LIBCONTAINERS_SOURCE_URL: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04" | ||
|
||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install podman v4 | ||
run: | | ||
echo "deb $OPENSUSE_UNOFFICIAL_LIBCONTAINERS_SOURCE_URL/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list | ||
curl -fsSL $OPENSUSE_UNOFFICIAL_LIBCONTAINERS_KEY_URL | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null | ||
sudo apt -y purge podman | ||
sudo apt update && sudo apt -y install podman | ||
- name: Start Podman API | ||
run: | | ||
systemctl --user enable --now podman.socket | ||
echo "DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock" >> "$GITHUB_ENV" | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ github.token }} | ||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
cache-dependency-path: app/web/db/itests/package-lock.json | ||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
working-directory: app/web/db/itests | ||
- name: Run tests | ||
working-directory: app/web/db | ||
run: make oci-build itest |
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,4 @@ | ||
boto3==1.34.43 | ||
botocore==1.34.43 | ||
boto3==1.34.47 | ||
botocore==1.34.47 | ||
numpy==1.26.4 | ||
opencv-python-headless==4.9.0.80 |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright [2023] [Privacypal Authors] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import AppointmentViewer from "@components/appointment/AppointmentViewer"; | ||
import { render, screen } from "@testing-library/react"; | ||
import { ViewableAppointment } from "@lib/appointment"; | ||
import { UserRole } from "@lib/userRole"; | ||
|
||
describe("AppointmentViewer Component", () => { | ||
const pro = { | ||
id: 1, | ||
username: "professional_test_user", | ||
email: "pro@example.com", | ||
firstName: "Pro", | ||
lastName: "User", | ||
role: UserRole.PROFESSIONAL, | ||
}; | ||
const client = { | ||
id: 2, | ||
username: "client_test_user", | ||
email: "client@example.com", | ||
firstName: "Client", | ||
lastName: "User", | ||
role: UserRole.CLIENT, | ||
}; | ||
const appt: ViewableAppointment = { | ||
id: 1, | ||
professionalUser: pro, | ||
clientUser: client, | ||
time: new Date(Date.UTC(2025, 0, 1, 12, 0, 0)), // jan 1st 2025 12:00 noon | ||
video_count: 1, | ||
}; | ||
|
||
it("component is unchanged from snapshot", () => { | ||
const { container: container } = render( | ||
<div> | ||
<AppointmentViewer appointment={appt} viewer={pro} />, | ||
<AppointmentViewer appointment={appt} viewer={client} /> | ||
</div>, | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
it("pro viewer has cancel and view details buttons", () => { | ||
const { container: proContainer } = render( | ||
<AppointmentViewer appointment={appt} viewer={pro} />, | ||
); | ||
expect(screen.getByText("Cancel appointment")).toBeDefined(); | ||
expect(screen.getByText("View appointment details")).toBeDefined(); | ||
}); | ||
it("client viewer has upload video button", () => { | ||
const { container: clientContainer } = render( | ||
<AppointmentViewer appointment={appt} viewer={client} />, | ||
); | ||
expect( | ||
screen.getByText("Upload a video to this appointment"), | ||
).toBeDefined(); | ||
}); | ||
}); |
99 changes: 99 additions & 0 deletions
99
app/web/__tests__/__snapshots__/AppointmentViewer.test.tsx.snap
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,99 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AppointmentViewer Component component is unchanged from snapshot 1`] = ` | ||
<div> | ||
<div> | ||
<div | ||
class="pf-v5-c-card" | ||
data-ouia-component-id="OUIA-Generated-Card-1" | ||
data-ouia-component-type="PF5/Card" | ||
data-ouia-safe="true" | ||
id="" | ||
> | ||
<div | ||
class="pf-v5-c-card__body" | ||
> | ||
<h2> | ||
Appointment | ||
</h2> | ||
<time> | ||
1/1/2025 | ||
</time> | ||
<p> | ||
Professional: | ||
Pro User | ||
</p> | ||
<p> | ||
Client: | ||
Client User | ||
</p> | ||
<p> | ||
Number of associated videos: | ||
1 | ||
</p> | ||
<button | ||
aria-disabled="false" | ||
class="pf-v5-c-button pf-m-danger" | ||
data-ouia-component-id="OUIA-Generated-Button-danger-1" | ||
data-ouia-component-type="PF5/Button" | ||
data-ouia-safe="true" | ||
type="button" | ||
> | ||
Cancel appointment | ||
</button> | ||
<a | ||
aria-disabled="false" | ||
class="pf-v5-c-button pf-m-primary" | ||
data-ouia-component-id="OUIA-Generated-Button-primary-1" | ||
data-ouia-component-type="PF5/Button" | ||
data-ouia-safe="true" | ||
href="/staff/appointment?id=1" | ||
> | ||
View appointment details | ||
</a> | ||
</div> | ||
</div> | ||
, | ||
<div | ||
class="pf-v5-c-card" | ||
data-ouia-component-id="OUIA-Generated-Card-2" | ||
data-ouia-component-type="PF5/Card" | ||
data-ouia-safe="true" | ||
id="" | ||
> | ||
<div | ||
class="pf-v5-c-card__body" | ||
> | ||
<h2> | ||
Appointment | ||
</h2> | ||
<time> | ||
1/1/2025 | ||
</time> | ||
<p> | ||
Professional: | ||
Pro User | ||
</p> | ||
<p> | ||
Client: | ||
Client User | ||
</p> | ||
<p> | ||
Number of associated videos: | ||
1 | ||
</p> | ||
<a | ||
aria-disabled="false" | ||
class="pf-v5-c-button pf-m-primary" | ||
data-ouia-component-id="OUIA-Generated-Button-primary-2" | ||
data-ouia-component-type="PF5/Button" | ||
data-ouia-safe="true" | ||
href="/upload" | ||
> | ||
Upload a video to this appointment | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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
Oops, something went wrong.