diff options
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/lib/components/CreateConversationForm.svelte | 2 | ||||
| -rw-r--r-- | ui/lib/components/LogIn.svelte | 4 | ||||
| -rw-r--r-- | ui/lib/components/MessageInput.svelte | 2 | ||||
| -rw-r--r-- | ui/routes/(app)/+layout.svelte | 4 | ||||
| -rw-r--r-- | ui/routes/(app)/c/[conversation]/+page.svelte | 4 | ||||
| -rw-r--r-- | ui/styles/sidebar.css | 3 | ||||
| -rw-r--r-- | ui/styles/textarea.css | 2 | ||||
| -rw-r--r-- | ui/tests/lib/components/LogIn.svelte.test.js | 7 |
8 files changed, 14 insertions, 14 deletions
diff --git a/ui/lib/components/CreateConversationForm.svelte b/ui/lib/components/CreateConversationForm.svelte index e390a78..812a5cf 100644 --- a/ui/lib/components/CreateConversationForm.svelte +++ b/ui/lib/components/CreateConversationForm.svelte @@ -16,7 +16,7 @@ } </script> -<form {onsubmit}> +<form class="create-conversation" {onsubmit}> <input type="text" placeholder="start a conversation" bind:value={name} {disabled} /> <button type="submit">➕</button> </form> diff --git a/ui/lib/components/LogIn.svelte b/ui/lib/components/LogIn.svelte index c49ea3b..b491583 100644 --- a/ui/lib/components/LogIn.svelte +++ b/ui/lib/components/LogIn.svelte @@ -1,8 +1,8 @@ <script> let { legend = 'sign in', logIn = async (username, password) => {} } = $props(); - let username = $state(); - let password = $state(); + let username = $state(''); + let password = $state(''); let disabled = $state(false); async function onsubmit(event) { diff --git a/ui/lib/components/MessageInput.svelte b/ui/lib/components/MessageInput.svelte index 77c39be..1a18f63 100644 --- a/ui/lib/components/MessageInput.svelte +++ b/ui/lib/components/MessageInput.svelte @@ -45,7 +45,7 @@ } </script> -<form {onsubmit}> +<form class="create-message" {onsubmit}> <textarea bind:value hidden {disabled}></textarea> <div role="textbox" diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte index 658d966..1210b43 100644 --- a/ui/routes/(app)/+layout.svelte +++ b/ui/routes/(app)/+layout.svelte @@ -121,9 +121,7 @@ <div id="interface"> <nav id="sidebar" data-expanded={pageContext.showMenu}> <ConversationList active={conversationId} {conversations} /> - <div class="create-conversation"> - <CreateConversationForm {createConversation} /> - </div> + <CreateConversationForm {createConversation} /> </nav> <main> {@render children?.()} diff --git a/ui/routes/(app)/c/[conversation]/+page.svelte b/ui/routes/(app)/c/[conversation]/+page.svelte index e6cd845..24baa47 100644 --- a/ui/routes/(app)/c/[conversation]/+page.svelte +++ b/ui/routes/(app)/c/[conversation]/+page.svelte @@ -116,6 +116,4 @@ </MessageRun> {/each} </div> -<div class="create-message"> - <MessageInput {sendMessage} /> -</div> +<MessageInput {sendMessage} /> diff --git a/ui/styles/sidebar.css b/ui/styles/sidebar.css index aa0d53b..a06c3e3 100644 --- a/ui/styles/sidebar.css +++ b/ui/styles/sidebar.css @@ -41,9 +41,6 @@ /* create conversation form */ .create-conversation { padding-left: 0.5rem; -} - -.create-conversation form { display: flex; flex-direction: row; justify-content: flex-start; diff --git a/ui/styles/textarea.css b/ui/styles/textarea.css index d315bcf..ef17a79 100644 --- a/ui/styles/textarea.css +++ b/ui/styles/textarea.css @@ -1,5 +1,5 @@ /* Message input */ -.create-message form { +.create-message { display: flex; flex-direction: row; justify-content: flex-start; diff --git a/ui/tests/lib/components/LogIn.svelte.test.js b/ui/tests/lib/components/LogIn.svelte.test.js index 00abb5c..0835870 100644 --- a/ui/tests/lib/components/LogIn.svelte.test.js +++ b/ui/tests/lib/components/LogIn.svelte.test.js @@ -31,4 +31,11 @@ describe('LogIn', async () => { 'my very creative and long password', ); }); + + it('sends empty strings before being populated', async () => { + const signIn = screen.getByRole('button'); + await user.click(signIn); + + expect(mocks.logIn).toHaveBeenCalledExactlyOnceWith('', ''); + }); }); |
