Refactor App component and update test_helper_components.py

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-11 18:00:46 -03:00
commit 4916f7f050
2 changed files with 13 additions and 15 deletions

View file

@ -103,7 +103,7 @@ export default function App() {
</ErrorBoundary> </ErrorBoundary>
<div></div> <div></div>
<div className="app-div"> <div className="app-div">
<div className="flex flex-col-reverse" style={{zIndex: 999}}> <div className="flex flex-col-reverse" style={{ zIndex: 999 }}>
{tempNotificationList.map((alert) => ( {tempNotificationList.map((alert) => (
<div key={alert.id}> <div key={alert.id}>
{alert.type === "error" && ( {alert.type === "error" && (
@ -118,7 +118,7 @@ export default function App() {
</div> </div>
))} ))}
</div> </div>
<div className="flex flex-col-reverse z-40"> <div className="z-40 flex flex-col-reverse">
{tempNotificationList.map((alert) => ( {tempNotificationList.map((alert) => (
<div key={alert.id}> <div key={alert.id}>
{alert.type === "notice" ? ( {alert.type === "notice" ? (
@ -129,13 +129,15 @@ export default function App() {
id={alert.id} id={alert.id}
removeAlert={removeAlert} removeAlert={removeAlert}
/> />
) : alert.type === "success" && ( ) : (
<SuccessAlert alert.type === "success" && (
key={alert.id} <SuccessAlert
title={alert.title} key={alert.id}
id={alert.id} title={alert.title}
removeAlert={removeAlert} id={alert.id}
/> removeAlert={removeAlert}
/>
)
)} )}
</div> </div>
))} ))}

View file

@ -24,9 +24,7 @@ def test_document_to_record_component():
# Act # Act
# Replace with your actual test data # Replace with your actual test data
document = Document( document = Document(page_content="key: value", metadata={"url": "https://example.com"})
page_content="key: value", metadata={"url": "https://example.com"}
)
result = document_to_record_component.build(document) result = document_to_record_component.build(document)
# Assert # Assert
@ -44,9 +42,7 @@ def test_uuid_generator_component():
# Act # Act
build_config = frontend_node.get("template") build_config = frontend_node.get("template")
field_name = "unique_id" field_name = "unique_id"
build_config = uuid_generator_component.update_build_config( build_config = uuid_generator_component.update_build_config(build_config, None, field_name)
build_config, None, field_name
)
unique_id = build_config["unique_id"]["value"] unique_id = build_config["unique_id"]["value"]
result = uuid_generator_component.build(unique_id) result = uuid_generator_component.build(unique_id)