Skip to content

Commit

Permalink
fix(ui): svelte check error create service (#1994)
Browse files Browse the repository at this point in the history
Signed-off-by: axel7083 <[email protected]>
  • Loading branch information
axel7083 authored Oct 25, 2024
1 parent 79d1543 commit 98580a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/frontend/src/pages/CreateService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,19 @@ test('tasks should be displayed after requestCreateInferenceServer', async () =>
});
});

test('port input should update on user input', async () => {
render(CreateService);

const portInput: HTMLInputElement = screen.getByRole('textbox', { name: 'Port input' });
expect(portInput).toBeDefined();

await fireEvent.input(portInput, '8888');

await vi.waitFor(() => {
expect(portInput.value).toBe('8888');
});
});

test('form should be disabled when loading', async () => {
mocks.modelsInfoSubscribeMock.mockReturnValue([{ id: 'random', file: true }]);

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/CreateService.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export function goToUpPage(): void {
>Container port</label>
<Input
type="number"
bind:value={containerPort}
value={String(containerPort ?? 0)}
on:input={onContainerPortInput}
class="w-full"
placeholder="8888"
Expand Down

0 comments on commit 98580a5

Please sign in to comment.