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

chore: Fix last path-to-regexp depenabot alert by using vite preview instead of serve #11015

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

Fix last `path-to-regexp` depenabot alert ([#11015](https://github.com/linode/manager/pull/11015))
3 changes: 1 addition & 2 deletions packages/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"scripts": {
"start": "concurrently --raw \"vite\" \"tsc --watch --preserveWatchOutput\"",
"start:expose": "concurrently --raw \"vite --host\" \"tsc --watch --preserveWatchOutput\"",
"start:ci": "yarn serve ./build -p 3000 -s --cors",
"start:ci": "vite preview --port 3000 --host",
"lint": "yarn run eslint . --ext .js,.ts,.tsx --quiet",
"build": "vite build",
"build:analyze": "bunx vite-bundle-visualizer",
Expand Down Expand Up @@ -199,7 +199,6 @@
"msw": "^2.2.3",
"prettier": "~2.2.1",
"redux-mock-store": "^1.5.3",
"serve": "^14.0.1",
"simple-git": "^3.19.0",
"storybook": "^8.3.0",
"storybook-dark-mode": "4.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ import { Security } from './Security';
import type { LinodeCreateFormValues } from './utilities';

describe('Security', () => {
it(
'should render a root password input',
async () => {
const { findByLabelText } = renderWithThemeAndHookFormContext({
component: <Security />,
});
// TODO: Unskip once M3-8559 is addressed.
it.skip('should render a root password input', async () => {
Copy link
Member Author

@bnussman-akamai bnussman-akamai Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I unskipped these in #11005 but they are still being flakey so I'm going to re-skip them. We have a ticket to further investigate this

const { findByLabelText } = renderWithThemeAndHookFormContext({
component: <Security />,
});

const rootPasswordInput = await findByLabelText('Root Password');
const rootPasswordInput = await findByLabelText('Root Password');

expect(rootPasswordInput).toBeVisible();
expect(rootPasswordInput).toBeEnabled();
},
{ timeout: 5_000 }
);
expect(rootPasswordInput).toBeVisible();
expect(rootPasswordInput).toBeEnabled();
});

it('should render a SSH Keys heading', async () => {
const { getAllByText } = renderWithThemeAndHookFormContext({
Expand All @@ -54,35 +51,32 @@ describe('Security', () => {
expect(addSSHKeyButton).toBeEnabled();
});

it(
'should disable the password input if the user does not have permission to create linodes',
async () => {
server.use(
http.get('*/v4/profile', () => {
return HttpResponse.json(profileFactory.build({ restricted: true }));
}),
http.get('*/v4/profile/sshkeys', () => {
return HttpResponse.json(makeResourcePage([]));
}),
http.get('*/v4/profile/grants', () => {
return HttpResponse.json(
grantsFactory.build({ global: { add_linodes: false } })
);
})
);

const { findByLabelText } = renderWithThemeAndHookFormContext({
component: <Security />,
});

const rootPasswordInput = await findByLabelText('Root Password');

await waitFor(() => {
expect(rootPasswordInput).toBeDisabled();
});
},
{ timeout: 5_000 }
);
// TODO: Unskip once M3-8559 is addressed.
it.skip('should disable the password input if the user does not have permission to create linodes', async () => {
server.use(
http.get('*/v4/profile', () => {
return HttpResponse.json(profileFactory.build({ restricted: true }));
}),
http.get('*/v4/profile/sshkeys', () => {
return HttpResponse.json(makeResourcePage([]));
}),
http.get('*/v4/profile/grants', () => {
return HttpResponse.json(
grantsFactory.build({ global: { add_linodes: false } })
);
})
);

const { findByLabelText } = renderWithThemeAndHookFormContext({
component: <Security />,
});

const rootPasswordInput = await findByLabelText('Root Password');

await waitFor(() => {
expect(rootPasswordInput).toBeDisabled();
});
});

it('should disable ssh key selection if the user does not have permission to create linodes', async () => {
const sshKeys = sshKeyFactory.buildList(3);
Expand Down
Loading
Loading