Skip to content

Commit

Permalink
1. added resetschema.sql function to reset testing schema
Browse files Browse the repository at this point in the history
2. formatting changes and consolidating some additional data
3. datagrid column arrays are in process of being moved into separate .tsx file so that Typography formatting can be applied to headers when needed (if column names are too large, etc)
4. Updated personnel fixeddata and cmprevalidation API endpoints to correctly work with updated PersonnelRDS type/table
5. Playwright initialization added and setup. No tests currently added, but future proofing for use.
6. RolloverModal added to handle rollover process when creating a new census. Allows users to selectively choose personnel OR quadrats to rollover from one OR more past censuses (where data is present).
7. Instead of discarding testing component file, was instead converted into the RolloverStemsModal. Its function has not been enabled but has been integrated. Allows users to additionally rollover stems data if needed ONLY if quadrats data is already being rolled over. Still needs to be fully tested and repaired (assuming bugs are present)
8. area selection options macro added now that dedicated selection array for area measurements added SQL-side.
  • Loading branch information
siddheshraze committed Jul 17, 2024
1 parent 042bded commit 6bc8a7e
Show file tree
Hide file tree
Showing 61 changed files with 5,820 additions and 1,017 deletions.
6 changes: 5 additions & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ yarn-error.log*
/blob-report/
/playwright/.cache/

*storybook.log
*storybook.log
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# The ForestGEO Data Entry App

liquibase generate-changelog --exclude-objects="\b\w*view\w*\b"
A cloud-native web application built to accelerate the pace of research for the Smithsonian
Institution's Forest Global Earth Observatory (ForestGEO). ForestGEO is a global forest research
network, unparalleled in size and scope, comprised of ecologists and research sites dedicated to
Expand Down
166 changes: 166 additions & 0 deletions frontend/__tests__/rollovermodal.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import RolloverModal from '@/components/client/rollovermodal';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import { describe, it, expect, vi, beforeEach } from 'vitest';

// Mock the fetch API
global.fetch = vi.fn();

// Mock contexts
vi.mock('@/app/contexts/userselectionprovider', () => ({
useSiteContext: () => ({ schemaName: 'testSchema' }),
usePlotContext: () => ({ plotID: 1 }),
}));
vi.mock('@/app/contexts/listselectionprovider', () => ({
useOrgCensusListContext: () => [
{ plotCensusNumber: 1, dateRanges: [{ censusID: 1 }] },
{ plotCensusNumber: 2, dateRanges: [{ censusID: 2 }] },
],
}));

// Mock Data
const previousPersonnel = [
{ personnelID: 1, name: 'Person 1' },
{ personnelID: 2, name: 'Person 2' },
];
const previousQuadrats = [
{ quadratID: 1, name: 'Quadrat 1' },
{ quadratID: 2, name: 'Quadrat 2' },
];

describe('RolloverModal Component', () => {
const setup = (props = {}) => render(
<RolloverModal
open={true}
onClose={vi.fn()}
onConfirm={vi.fn()}
{...props}
/>
);

beforeEach(() => {
(global.fetch as jest.Mock).mockClear();

(global.fetch as jest.Mock).mockImplementation((url: string) => {
if (url.includes('/fetchall/personnel/')) {
return Promise.resolve({
status: 200,
json: () => Promise.resolve(previousPersonnel),
});
}
if (url.includes('/fetchall/quadrats/')) {
return Promise.resolve({
status: 200,
json: () => Promise.resolve(previousQuadrats),
});
}
if (url.includes('/cmprevalidation/personnel/')) {
return Promise.resolve({
status: 200,
});
}
if (url.includes('/cmprevalidation/quadrats/')) {
return Promise.resolve({
status: 200,
});
}
return Promise.reject(new Error('Unknown API call'));
});
});

it('should open modal and display title', async () => {
setup();
await waitFor(() => {
expect(screen.getByText(/Rollover Census Data/i)).toBeInTheDocument();
});
});

it('should show error if no checkbox is selected and confirm is pressed', async () => {
setup();
fireEvent.click(screen.getByText(/Confirm/i));

Check failure on line 79 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should show error if no checkbox is selected and confirm is pressed

TestingLibraryElementError: Unable to find an element with the text: /Confirm/i. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":rb:" aria-labelledby=":ra:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-evgva4-JoyModalDialog-root" role="dialog" tabindex="-1" > <p class="MuiTypography-root MuiTypography-body-md css-ff7dcq-JoyTypography-root" data-first-child="" data-last-child="" > Loading... </p> </div> <div data-testid="sentinelEnd" tabindex="0" /> </div> </body> ❯ Object.getElementError node_modules/@testing-library/dom/dist/config.js:37:19 ❯ node_modules/@testing-library/dom/dist/query-helpers.js:76:38 ❯ node_modules/@testing-library/dom/dist/query-helpers.js:52:17 ❯ getByText node_modules/@testing-library/dom/dist/query-helpers.js:95:19 ❯ __tests__/rollovermodal.test.tsx:79:28
await waitFor(() => {
expect(screen.getByText(/You must select at least one option to roll over or confirm no rollover/i)).toBeInTheDocument();
});
});

it('should allow selecting and confirming personnel rollover', async () => {
setup();
await waitFor(() => {

Check failure on line 87 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should allow selecting and confirming personnel rollover

TestingLibraryElementError: Unable to find a label with the text of: /Roll over personnel data/i Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":rd:" aria-labelledby=":rc:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-1q51y9w-JoyModalDialog-root" role="alertdialog" tabindex="-1" > <h2 class="MuiDialogTitle-root MuiDialogTitle-title-lg css-107zp01-JoyDialogTitle-root" data-first-child="" id=":rc:" > <div class="MuiStack-root css-eggeq0-MuiStack-root" > <p class="MuiTypography-root MuiTypography-title-lg css-ar9ysw-JoyTypography-root" > Rollover Census Data </p> <button class="MuiIconButton-root MuiIconButton-variantPlain MuiIconButton-colorNeutral MuiIconButton-sizeSm css-2y7960-JoyIconButton-root" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" data-testid="CloseIcon" focusable="false" viewBox="0 0 24 24" > <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" /> </svg> </button> </div> </h2> <div class="MuiDialogContent-root css-1214yk7-JoyDialogContent-root" id=":rd:" > <div class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row MuiGrid-spacing-xs-2 css-1hji899-JoyGrid-root" > <div class="MuiGrid-root MuiGrid-direction-xs-row MuiGrid-grid-xs-auto css-jpwrl1-JoyGrid-root" > <p class="MuiTypography-root MuiTypography-title-md css-1jdjnao-JoyTypography-root" > Roll over <b> Personnel </b> data: </p> <div class="MuiSelect-root MuiSelect-variantOutlined MuiSelect-colorNeutral MuiSelect-sizeMd css-cb4rgu-JoySelect-root" > <button aria-controls=":re:" aria-expanded="false" class="MuiSelect-button css-1hr8yhh-JoySelect-button" role="combobox" type="button" /> <span class="MuiSelect-indicator css-b0m4zx-JoySelect-indicator" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-sizeMd css-1r2bn3-JoySvgIcon-root" data-testid="UnfoldIcon" focusable="false" viewBox="0 0 24 24" > <path d="m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z" /> </svg> </span> <input aria-hidden="true" style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; white-space: nowrap; width: 1px;" tabindex="-1" value="0" /> </div> <div
fireEvent.click(screen.getByLabelText(/Roll over personnel data/i));
});
fireEvent.click(screen.getByText(/Confirm/i));
await waitFor(() => {
expect(screen.queryByText(/You must select at least one option to roll over or confirm no rollover/i)).toBeNull();
});
});

it('should allow selecting and confirming quadrats rollover', async () => {
setup();
await waitFor(() => {

Check failure on line 98 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should allow selecting and confirming quadrats rollover

TestingLibraryElementError: Unable to find a label with the text of: /Roll over quadrats data/i Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":rn:" aria-labelledby=":rm:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-1q51y9w-JoyModalDialog-root" role="alertdialog" tabindex="-1" > <h2 class="MuiDialogTitle-root MuiDialogTitle-title-lg css-107zp01-JoyDialogTitle-root" data-first-child="" id=":rm:" > <div class="MuiStack-root css-eggeq0-MuiStack-root" > <p class="MuiTypography-root MuiTypography-title-lg css-ar9ysw-JoyTypography-root" > Rollover Census Data </p> <button class="MuiIconButton-root MuiIconButton-variantPlain MuiIconButton-colorNeutral MuiIconButton-sizeSm css-2y7960-JoyIconButton-root" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" data-testid="CloseIcon" focusable="false" viewBox="0 0 24 24" > <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" /> </svg> </button> </div> </h2> <div class="MuiDialogContent-root css-1214yk7-JoyDialogContent-root" id=":rn:" > <div class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row MuiGrid-spacing-xs-2 css-1hji899-JoyGrid-root" > <div class="MuiGrid-root MuiGrid-direction-xs-row MuiGrid-grid-xs-auto css-jpwrl1-JoyGrid-root" > <p class="MuiTypography-root MuiTypography-title-md css-1jdjnao-JoyTypography-root" > Roll over <b> Personnel </b> data: </p> <div class="MuiSelect-root MuiSelect-variantOutlined MuiSelect-colorNeutral MuiSelect-sizeMd css-cb4rgu-JoySelect-root" > <button aria-controls=":ro:" aria-expanded="false" class="MuiSelect-button css-1hr8yhh-JoySelect-button" role="combobox" type="button" /> <span class="MuiSelect-indicator css-b0m4zx-JoySelect-indicator" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-sizeMd css-1r2bn3-JoySvgIcon-root" data-testid="UnfoldIcon" focusable="false" viewBox="0 0 24 24" > <path d="m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z" /> </svg> </span> <input aria-hidden="true" style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; white-space: nowrap; width: 1px;" tabindex="-1" value="0" /> </div> <div
fireEvent.click(screen.getByLabelText(/Roll over quadrats data/i));
});
fireEvent.click(screen.getByText(/Confirm/i));
await waitFor(() => {
expect(screen.queryByText(/You must select at least one option to roll over or confirm no rollover/i)).toBeNull();
});
});

it('should allow selecting and confirming both personnel and quadrats rollover', async () => {
setup();
await waitFor(() => {

Check failure on line 109 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should allow selecting and confirming both personnel and quadrats rollover

TestingLibraryElementError: Unable to find a label with the text of: /Roll over personnel data/i Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":r11:" aria-labelledby=":r10:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-1q51y9w-JoyModalDialog-root" role="alertdialog" tabindex="-1" > <h2 class="MuiDialogTitle-root MuiDialogTitle-title-lg css-107zp01-JoyDialogTitle-root" data-first-child="" id=":r10:" > <div class="MuiStack-root css-eggeq0-MuiStack-root" > <p class="MuiTypography-root MuiTypography-title-lg css-ar9ysw-JoyTypography-root" > Rollover Census Data </p> <button class="MuiIconButton-root MuiIconButton-variantPlain MuiIconButton-colorNeutral MuiIconButton-sizeSm css-2y7960-JoyIconButton-root" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" data-testid="CloseIcon" focusable="false" viewBox="0 0 24 24" > <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" /> </svg> </button> </div> </h2> <div class="MuiDialogContent-root css-1214yk7-JoyDialogContent-root" id=":r11:" > <div class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row MuiGrid-spacing-xs-2 css-1hji899-JoyGrid-root" > <div class="MuiGrid-root MuiGrid-direction-xs-row MuiGrid-grid-xs-auto css-jpwrl1-JoyGrid-root" > <p class="MuiTypography-root MuiTypography-title-md css-1jdjnao-JoyTypography-root" > Roll over <b> Personnel </b> data: </p> <div class="MuiSelect-root MuiSelect-variantOutlined MuiSelect-colorNeutral MuiSelect-sizeMd css-cb4rgu-JoySelect-root" > <button aria-controls=":r12:" aria-expanded="false" class="MuiSelect-button css-1hr8yhh-JoySelect-button" role="combobox" type="button" /> <span class="MuiSelect-indicator css-b0m4zx-JoySelect-indicator" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-sizeMd css-1r2bn3-JoySvgIcon-root" data-testid="UnfoldIcon" focusable="false" viewBox="0 0 24 24" > <path d="m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z" /> </svg> </span> <input aria-hidden="true" style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; white-space: nowrap; width: 1px;" tabindex="-1" value="0" /> </div> <div
fireEvent.click(screen.getByLabelText(/Roll over personnel data/i));
fireEvent.click(screen.getByLabelText(/Roll over quadrats data/i));
});
fireEvent.click(screen.getByText(/Confirm/i));
await waitFor(() => {
expect(screen.queryByText(/You must select at least one option to roll over or confirm no rollover/i)).toBeNull();
});
});

it('should allow customizing personnel selection', async () => {
setup();
await waitFor(() => {

Check failure on line 121 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should allow customizing personnel selection

TestingLibraryElementError: Unable to find a label with the text of: /Roll over personnel data/i Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":r1b:" aria-labelledby=":r1a:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-1q51y9w-JoyModalDialog-root" role="alertdialog" tabindex="-1" > <h2 class="MuiDialogTitle-root MuiDialogTitle-title-lg css-107zp01-JoyDialogTitle-root" data-first-child="" id=":r1a:" > <div class="MuiStack-root css-eggeq0-MuiStack-root" > <p class="MuiTypography-root MuiTypography-title-lg css-ar9ysw-JoyTypography-root" > Rollover Census Data </p> <button class="MuiIconButton-root MuiIconButton-variantPlain MuiIconButton-colorNeutral MuiIconButton-sizeSm css-2y7960-JoyIconButton-root" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" data-testid="CloseIcon" focusable="false" viewBox="0 0 24 24" > <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" /> </svg> </button> </div> </h2> <div class="MuiDialogContent-root css-1214yk7-JoyDialogContent-root" id=":r1b:" > <div class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row MuiGrid-spacing-xs-2 css-1hji899-JoyGrid-root" > <div class="MuiGrid-root MuiGrid-direction-xs-row MuiGrid-grid-xs-auto css-jpwrl1-JoyGrid-root" > <p class="MuiTypography-root MuiTypography-title-md css-1jdjnao-JoyTypography-root" > Roll over <b> Personnel </b> data: </p> <div class="MuiSelect-root MuiSelect-variantOutlined MuiSelect-colorNeutral MuiSelect-sizeMd css-cb4rgu-JoySelect-root" > <button aria-controls=":r1c:" aria-expanded="false" class="MuiSelect-button css-1hr8yhh-JoySelect-button" role="combobox" type="button" /> <span class="MuiSelect-indicator css-b0m4zx-JoySelect-indicator" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-sizeMd css-1r2bn3-JoySvgIcon-root" data-testid="UnfoldIcon" focusable="false" viewBox="0 0 24 24" > <path d="m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z" /> </svg> </span> <input aria-hidden="true" style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; white-space: nowrap; width: 1px;" tabindex="-1" value="0" /> </div> <div
fireEvent.click(screen.getByLabelText(/Roll over personnel data/i));
fireEvent.click(screen.getByText(/Customize personnel selection/i));
});
expect(screen.getByText(/Person 1/i)).toBeInTheDocument();
expect(screen.getByText(/Person 2/i)).toBeInTheDocument();
});

it('should allow customizing quadrats selection', async () => {
setup();
await waitFor(() => {

Check failure on line 131 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should allow customizing quadrats selection

TestingLibraryElementError: Unable to find a label with the text of: /Roll over quadrats data/i Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":r1l:" aria-labelledby=":r1k:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-1q51y9w-JoyModalDialog-root" role="alertdialog" tabindex="-1" > <h2 class="MuiDialogTitle-root MuiDialogTitle-title-lg css-107zp01-JoyDialogTitle-root" data-first-child="" id=":r1k:" > <div class="MuiStack-root css-eggeq0-MuiStack-root" > <p class="MuiTypography-root MuiTypography-title-lg css-ar9ysw-JoyTypography-root" > Rollover Census Data </p> <button class="MuiIconButton-root MuiIconButton-variantPlain MuiIconButton-colorNeutral MuiIconButton-sizeSm css-2y7960-JoyIconButton-root" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" data-testid="CloseIcon" focusable="false" viewBox="0 0 24 24" > <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" /> </svg> </button> </div> </h2> <div class="MuiDialogContent-root css-1214yk7-JoyDialogContent-root" id=":r1l:" > <div class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row MuiGrid-spacing-xs-2 css-1hji899-JoyGrid-root" > <div class="MuiGrid-root MuiGrid-direction-xs-row MuiGrid-grid-xs-auto css-jpwrl1-JoyGrid-root" > <p class="MuiTypography-root MuiTypography-title-md css-1jdjnao-JoyTypography-root" > Roll over <b> Personnel </b> data: </p> <div class="MuiSelect-root MuiSelect-variantOutlined MuiSelect-colorNeutral MuiSelect-sizeMd css-cb4rgu-JoySelect-root" > <button aria-controls=":r1m:" aria-expanded="false" class="MuiSelect-button css-1hr8yhh-JoySelect-button" role="combobox" type="button" /> <span class="MuiSelect-indicator css-b0m4zx-JoySelect-indicator" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-sizeMd css-1r2bn3-JoySvgIcon-root" data-testid="UnfoldIcon" focusable="false" viewBox="0 0 24 24" > <path d="m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z" /> </svg> </span> <input aria-hidden="true" style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; white-space: nowrap; width: 1px;" tabindex="-1" value="0" /> </div> <div
fireEvent.click(screen.getByLabelText(/Roll over quadrats data/i));
fireEvent.click(screen.getByText(/Customize quadrats selection/i));
});
expect(screen.getByText(/Quadrat 1/i)).toBeInTheDocument();
expect(screen.getByText(/Quadrat 2/i)).toBeInTheDocument();
});

it('should confirm no rollover for personnel', async () => {
setup();
fireEvent.mouseDown(screen.getByLabelText(/Do not roll over any Personnel data/i));

Check failure on line 141 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should confirm no rollover for personnel

TestingLibraryElementError: Unable to find a label with the text of: /Do not roll over any Personnel data/i Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":r1v:" aria-labelledby=":r1u:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-evgva4-JoyModalDialog-root" role="dialog" tabindex="-1" > <p class="MuiTypography-root MuiTypography-body-md css-ff7dcq-JoyTypography-root" data-first-child="" data-last-child="" > Loading... </p> </div> <div data-testid="sentinelEnd" tabindex="0" /> </div> </body> ❯ Object.getElementError node_modules/@testing-library/dom/dist/config.js:37:19 ❯ getAllByLabelText node_modules/@testing-library/dom/dist/queries/label-text.js:111:38 ❯ node_modules/@testing-library/dom/dist/query-helpers.js:52:17 ❯ getByLabelText node_modules/@testing-library/dom/dist/query-helpers.js:95:19 ❯ __tests__/rollovermodal.test.tsx:141:32
fireEvent.click(screen.getByText(/Confirm No Rollover/i));
fireEvent.click(screen.getByText(/Confirm/i));
await waitFor(() => {
expect(screen.queryByText(/You must select at least one option to roll over or confirm no rollover/i)).toBeNull();
});
});

it('should confirm no rollover for quadrats', async () => {
setup();
fireEvent.mouseDown(screen.getByLabelText(/Do not roll over any Quadrats data/i));

Check failure on line 151 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should confirm no rollover for quadrats

TestingLibraryElementError: Unable to find a label with the text of: /Do not roll over any Quadrats data/i Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":r21:" aria-labelledby=":r20:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-evgva4-JoyModalDialog-root" role="dialog" tabindex="-1" > <p class="MuiTypography-root MuiTypography-body-md css-ff7dcq-JoyTypography-root" data-first-child="" data-last-child="" > Loading... </p> </div> <div data-testid="sentinelEnd" tabindex="0" /> </div> </body> ❯ Object.getElementError node_modules/@testing-library/dom/dist/config.js:37:19 ❯ getAllByLabelText node_modules/@testing-library/dom/dist/queries/label-text.js:111:38 ❯ node_modules/@testing-library/dom/dist/query-helpers.js:52:17 ❯ getByLabelText node_modules/@testing-library/dom/dist/query-helpers.js:95:19 ❯ __tests__/rollovermodal.test.tsx:151:32
fireEvent.click(screen.getByText(/Confirm No Rollover/i));
fireEvent.click(screen.getByText(/Confirm/i));
await waitFor(() => {
expect(screen.queryByText(/You must select at least one option to roll over or confirm no rollover/i)).toBeNull();
});
});

it('should handle error during fetch data', async () => {
(global.fetch as jest.Mock).mockImplementationOnce(() => Promise.reject(new Error('Failed to fetch')));

Check failure on line 160 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

Unhandled error

Error: Failed to fetch ❯ __tests__/rollovermodal.test.tsx:160:77 ❯ mockCall node_modules/@vitest/spy/dist/index.js:61:17 ❯ fetch node_modules/tinyspy/dist/index.js:45:80 ❯ map components/client/rollovermodal.tsx:104:36 ❯ validatePreviousCensusData components/client/rollovermodal.tsx:95:56 ❯ components/client/rollovermodal.tsx:125:7 ❯ commitHookEffectListMount node_modules/react-dom/cjs/react-dom.development.js:23189:26 ❯ commitPassiveMountOnFiber node_modules/react-dom/cjs/react-dom.development.js:24970:11 ❯ commitPassiveMountEffects_complete node_modules/react-dom/cjs/react-dom.development.js:24930:9 This error originated in "__tests__/rollovermodal.test.tsx" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "should handle error during fetch data". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
setup();
await waitFor(() => {

Check failure on line 162 in frontend/__tests__/rollovermodal.test.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

__tests__/rollovermodal.test.tsx > RolloverModal Component > should handle error during fetch data

TestingLibraryElementError: Unable to find an element with the text: /Failed to fetch previous data. Please try again/i. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":r23:" aria-labelledby=":r22:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-evgva4-JoyModalDialog-root" role="dialog" tabindex="-1" > <p class="MuiTypography-root MuiTypography-body-md css-ff7dcq-JoyTypography-root" data-first-child="" data-last-child="" > Loading... </p> </div> <div data-testid="sentinelEnd" tabindex="0" /> </div> </body> Ignored nodes: comments, script, style <html> <head /> <body style="padding-right: 1024px; overflow: hidden;" > <div aria-hidden="true" /> <div class="MuiModal-root css-12qgyx-JoyModal-root" role="presentation" > <div aria-hidden="true" class="MuiModal-backdrop css-pg81nb-JoyModal-backdrop" open="" /> <div data-testid="sentinelStart" tabindex="0" /> <div aria-describedby=":r23:" aria-labelledby=":r22:" aria-modal="true" class="MuiModalDialog-root MuiModalDialog-variantOutlined MuiModalDialog-colorNeutral MuiModalDialog-sizeMd MuiModalDialog-layoutCenter css-evgva4-JoyModalDialog-root" role="dialog" tabindex="-1" > <p class="MuiTypography-root MuiTypography-body-md css-ff7dcq-JoyTypography-root" data-first-child="" data-last-child="" > Loading... </p> </div> <div data-testid="sentinelEnd" tabindex="0" /> </div> </body> </html>... ❯ Proxy.waitFor node_modules/@testing-library/dom/dist/wait-for.js:163:27 ❯ __tests__/rollovermodal.test.tsx:162:11
expect(screen.getByText(/Failed to fetch previous data. Please try again/i)).toBeInTheDocument();
});
});
});
6 changes: 3 additions & 3 deletions frontend/app/(hub)/measurementshub/summary/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { useEffect, useState } from "react";
import { GridRowModes, GridRowModesModel, GridRowsProp } from "@mui/x-data-grid";
import { Alert, AlertProps, LinearProgress, Tooltip, TooltipProps, styled, tooltipClasses } from "@mui/material";
import { gridColumnsArrayMSVRDS, initialMeasurementsSummaryViewRDSRow } from '@/config/sqlrdsdefinitions/views/measurementssummaryviewrds';
import { initialMeasurementsSummaryViewRDSRow } from '@/config/sqlrdsdefinitions/views/measurementssummaryviewrds';
import { Box, ListItemContent, ListItem, List, Modal, ModalDialog, Typography, Button, DialogTitle, DialogContent, DialogActions, Snackbar, Stack, } from "@mui/joy";
import Select, { SelectOption } from "@mui/joy/Select";
import { useSession } from "next-auth/react";
Expand All @@ -15,7 +15,7 @@ import Option from '@mui/joy/Option';
import MeasurementSummaryGrid from "@/components/datagrids/msvdatagrid";
import { useDataValidityContext } from "@/app/contexts/datavalidityprovider";
import { UnifiedValidityFlags } from "@/config/macros";

import { msvGridColumns } from "@/components/client/datagridcolumns";
const LargeTooltip = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} classes={{ popper: className }} />
))(({ theme }) => ({
Expand Down Expand Up @@ -321,7 +321,7 @@ export default function SummaryPage() {
formType={"measurements"}
/>
<MeasurementSummaryGrid
gridColumns={gridColumnsArrayMSVRDS[0]}
gridColumns={msvGridColumns}
rows={rows}
setRows={setRows}
rowCount={rowCount}
Expand Down
33 changes: 19 additions & 14 deletions frontend/app/api/cmprevalidation/[dataType]/[[...slugs]]/route.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {getConn, runQuery} from "@/components/processors/processormacros";
import {PoolConnection} from "mysql2/promise";
import {NextRequest, NextResponse} from "next/server";
import {HTTPResponses} from "@/config/macros";
import { getConn, runQuery } from "@/components/processors/processormacros";
import { PoolConnection } from "mysql2/promise";
import { NextRequest, NextResponse } from "next/server";
import { HTTPResponses } from "@/config/macros";

// datatype: table name
// expecting 1) schema 2) plotID 3) plotCensusNumber
export async function GET(_request: NextRequest, {params}: { params: { dataType: string, slugs?: string[] } }) {
export async function GET(_request: NextRequest, { params }: { params: { dataType: string, slugs?: string[] } }) {
if (!params.slugs || !params.dataType) throw new Error("missing slugs");
const [schema, plotID, plotCensusNumber] = params.slugs;
if ((!schema || schema === 'undefined') || (!plotID || plotID === 'undefined') || (!plotCensusNumber || plotCensusNumber === 'undefined') || (params.slugs.length > 3 || params.slugs.length < 3)) throw new Error("incorrect slugs provided");
Expand All @@ -16,18 +16,23 @@ export async function GET(_request: NextRequest, {params}: { params: { dataType:

switch (params.dataType) {
case 'attributes':
case 'personnel':
case 'species':
const baseQuery = `SELECT 1 FROM ${schema}.${params.dataType} LIMIT 1`; // Check if the table has any row
const baseResults = await runQuery(connection, baseQuery);
if (connection) connection.release();
if (baseResults.length === 0) return new NextResponse(null, {status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE});
if (baseResults.length === 0) return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });
break;
case 'personnel':
const pQuery = `SELECT 1 FROM ${schema}.${params.dataType} WHERE CensusID IN (SELECT CensusID from ${schema}.census WHERE PlotCensusNumber = ${plotCensusNumber})`; // Check if the table has any row
const pResults = await runQuery(connection, pQuery);
if (connection) connection.release();
if (pResults.length === 0) return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });
break;
case 'quadrats':
const query = `SELECT 1 FROM ${schema}.${params.dataType} WHERE PlotID = ${plotID} AND CensusID IN (SELECT CensusID from ${schema}.census WHERE PlotCensusNumber = ${plotCensusNumber})`; // Check if the table has any row
const results = await runQuery(connection, query);
if (connection) connection.release();
if (results.length === 0) return new NextResponse(null, {status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE});
if (results.length === 0) return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });
break;
case 'subquadrats':
const subquadratsQuery = `SELECT 1
Expand All @@ -37,7 +42,7 @@ export async function GET(_request: NextRequest, {params}: { params: { dataType:
AND q.CensusID IN (SELECT CensusID from ${schema}.census WHERE PlotCensusNumber = ${plotCensusNumber}) LIMIT 1`;
const subquadratsResults = await runQuery(connection, subquadratsQuery);
if (connection) connection.release();
if (subquadratsResults.length === 0) return new NextResponse(null, {status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE});
if (subquadratsResults.length === 0) return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });
break;
case 'quadratpersonnel':
// Validation for quadrats table
Expand All @@ -47,24 +52,24 @@ export async function GET(_request: NextRequest, {params}: { params: { dataType:
AND CensusID IN (SELECT CensusID from ${schema}.census WHERE PlotCensusNumber = ${plotCensusNumber}) LIMIT 1`;
const quadratsResults = await runQuery(connection, quadratsQuery);
if (connection) connection.release();
if (quadratsResults.length === 0) return new NextResponse(null, {status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE});
if (quadratsResults.length === 0) return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });

// Validation for personnel table
const personnelQuery = `SELECT 1 FROM ${schema}.personnel LIMIT 1`;
const personnelResults = await runQuery(connection, personnelQuery);
if (connection) connection.release();
if (personnelResults.length === 0) return new NextResponse(null, {status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE});
if (personnelResults.length === 0) return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });

break;
default:
return new NextResponse(null, {status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE});
return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });
}
// If all conditions are satisfied
connection.release();
return new NextResponse(null, {status: 200});
return new NextResponse(null, { status: HTTPResponses.OK });
} catch (e: any) {
console.error(e);
return new NextResponse(null, {status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE});
return new NextResponse(null, { status: HTTPResponses.PRECONDITION_VALIDATION_FAILURE });
} finally {
if (connection) connection.release();
}
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/api/details/cmid/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {NextRequest, NextResponse} from "next/server";
import {getConn, runQuery} from "@/components/processors/processormacros";
import {PoolConnection} from "mysql2/promise";
import { HTTPResponses } from "@/config/macros";

export async function GET(request: NextRequest) {
const cmID = parseInt(request.nextUrl.searchParams.get('cmid')!);
Expand Down Expand Up @@ -49,7 +50,7 @@ export async function GET(request: NextRequest) {
personnelName: row.FirstName + ' ' + row.LastName,
speciesName: row.SpeciesName
}))
), {status: 200});
), {status: HTTPResponses.OK});
} catch (error: any) {
throw new Error('SQL query failed: ' + error.message);
} finally {
Expand Down
20 changes: 8 additions & 12 deletions frontend/app/api/fetchall/[[...slugs]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ const buildQuery = (schema: string, fetchType: string, plotID?: string, plotCens
let query = `SELECT * FROM ${schema}.${fetchType}`;
const conditions = [];

if (plotID && plotID !== 'undefined' && !isNaN(parseInt(plotID))) conditions.push(`PlotID = ${plotID}`);
if (plotID && plotID !== 'undefined' && !isNaN(parseInt(plotID)) && fetchType !== 'personnel') conditions.push(`PlotID = ${plotID}`);
if (plotCensusNumber && plotCensusNumber !== 'undefined' && !isNaN(parseInt(plotCensusNumber))) {
conditions.push(`CensusID IN (
SELECT c.CensusID
FROM ${schema}.census c
WHERE c.PlotID = PlotID
AND c.PlotCensusNumber = ${plotCensusNumber})`);
conditions.push(`CensusID IN ( SELECT c.CensusID FROM ${schema}.census c WHERE c.PlotID = ${plotID} AND c.PlotCensusNumber = ${plotCensusNumber})`);
}
if (quadratID && quadratID !== 'undefined' && !isNaN(parseInt(quadratID))) conditions.push(`QuadratID = ${quadratID}`);

Expand All @@ -38,20 +34,20 @@ const buildQuery = (schema: string, fetchType: string, plotID?: string, plotCens
return query;
};


// ordering: PCQ
export async function GET(request: NextRequest, {params}: { params: { slugs?: string[] } }) {
const schema = request.nextUrl.searchParams.get('schema');
if (!schema || schema === 'undefined') {
throw new Error("Schema selection was not provided to API endpoint");
}

const [fetchType, plotID, censusID, quadratID] = params.slugs ?? [];
if (!fetchType) {
const [dataType, plotID, censusID, quadratID] = params.slugs ?? [];
if (!dataType) {
throw new Error("fetchType was not correctly provided");
}

console.log('fetchall --> slugs provided: fetchType: ', fetchType, 'plotID: ', plotID, 'censusID: ', censusID, 'quadratID: ', quadratID);
const query = buildQuery(schema, fetchType, plotID, censusID, quadratID);
console.log('fetchall --> slugs provided: fetchType: ', dataType, 'plotID: ', plotID, 'censusID: ', censusID, 'quadratID: ', quadratID);
const query = buildQuery(schema, dataType, plotID, censusID, quadratID);
let conn: PoolConnection | null = null;

try {
Expand All @@ -61,7 +57,7 @@ export async function GET(request: NextRequest, {params}: { params: { slugs?: st
return new NextResponse(null, {status: 500});
}

const mapper: IDataMapper<any, any> = MapperFactory.getMapper<any, any>(fetchType);
const mapper: IDataMapper<any, any> = MapperFactory.getMapper<any, any>(dataType);
const rows = mapper.mapData(results);
return new NextResponse(JSON.stringify(rows), {status: HTTPResponses.OK});
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/api/filehandlers/deletefile/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {NextRequest, NextResponse} from "next/server";
import {getContainerClient} from "@/config/macros/azurestorage";
import { HTTPResponses } from "@/config/macros";

export async function DELETE(request: NextRequest) {
const containerName = request.nextUrl.searchParams.get('container');
Expand All @@ -15,7 +16,7 @@ export async function DELETE(request: NextRequest) {
const blobClient = containerClient.getBlobClient(filename);

await blobClient.delete();
return new NextResponse('File deleted successfully', {status: 200});
return new NextResponse('File deleted successfully', {status: HTTPResponses.OK});
} catch (error) {
console.error('Delete file error:', error);
return new NextResponse((error as Error).message, {status: 500});
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/api/filehandlers/downloadallfiles/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// DOWNLOAD ALL FILES ROUTE HANDLER
import {NextRequest, NextResponse} from "next/server";
import {getContainerClient} from "@/config/macros/azurestorage";
import { HTTPResponses } from "@/config/macros";


export async function GET(request: NextRequest) {
Expand Down Expand Up @@ -41,7 +42,7 @@ export async function GET(request: NextRequest) {
responseMessage: "List of files",
blobData: blobData,
}),
{status: 200}
{status: HTTPResponses.OK}
);
} catch (error: any) {
console.error('error in blob listing: ', error);
Expand Down
Loading

0 comments on commit 6bc8a7e

Please sign in to comment.