-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0f21fc
commit f9c8472
Showing
7 changed files
with
195 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
Screen { | ||
layout: vertical; | ||
} | ||
|
||
.box { | ||
border: solid green; | ||
min-width: 150; | ||
} | ||
|
||
.hide { | ||
display: none; | ||
} | ||
|
||
#explanations-keys { | ||
margin-left: 2; | ||
} | ||
|
||
Requests { | ||
layout: grid; | ||
grid-size: 5 5; | ||
grid-columns: 0.7fr 1fr 1fr 1fr 1fr; | ||
grid-rows: 1 3 3 3 3; | ||
max-height: 15; | ||
} | ||
|
||
#request-title { | ||
column-span: 5; | ||
} | ||
|
||
#nodes-container { | ||
row-span: 4; | ||
max-width: 24; | ||
} | ||
|
||
#nodes { | ||
max-height: 9; | ||
} | ||
|
||
#nslc, #timeframe, #options, #send-request { | ||
column-span: 4; | ||
} | ||
|
||
.request-label { | ||
margin-top: 1; | ||
} | ||
|
||
.short-input { | ||
width: 16; | ||
} | ||
|
||
AutoComplete { | ||
max-height: 4; | ||
max-width: 16; | ||
margin-right: 3; | ||
align: left top; | ||
} | ||
|
||
.date-input { | ||
width: 27; | ||
margin-right: 1; | ||
} | ||
|
||
#times { | ||
width: 30; | ||
} | ||
|
||
#mergegaps { | ||
max-width: 12; | ||
} | ||
|
||
#request-button { | ||
margin: 0 5 0 5; | ||
} | ||
|
||
#post-file { | ||
width: 50; | ||
} | ||
|
||
#status-container { | ||
max-height: 5; | ||
} | ||
|
||
#status-collapse { | ||
max-height: 10; | ||
} | ||
|
||
#error-results { | ||
margin-left: 2; | ||
} | ||
|
||
ContentSwitcher { | ||
margin-left: 2; | ||
} | ||
|
||
#info-bar { | ||
background: $primary; | ||
} | ||
|
||
#lines { | ||
height: auto; | ||
} | ||
|
||
#results-container { | ||
max-height: 29; | ||
height: auto; | ||
} | ||
|
||
#plain-container { | ||
max-height: 30; | ||
height: auto; | ||
} | ||
|
||
.result-item { | ||
height: auto; | ||
} | ||
|
||
CursoredText { | ||
margin-left: 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from a10y.app import AvailabilityUI | ||
from textual.app import App | ||
import pytest | ||
|
||
@pytest.mark.asyncio | ||
async def test_send_button(): | ||
"""Test clicking the send button.""" | ||
|
||
|
||
config = { | ||
"default_starttime": "2024-01-01T00:00:00", | ||
"default_endtime": "2024-01-02T00:00:00", | ||
"default_mergegaps": "0.0", | ||
"default_merge_samplerate": False, | ||
"default_merge_quality": False, | ||
"default_merge_overlap": False, | ||
"default_quality_D": False, | ||
"default_quality_R": False, | ||
"default_quality_Q": False, | ||
"default_quality_M": False, | ||
"default_includerestricted": False, | ||
"default_file": "", | ||
} | ||
|
||
app = AvailabilityUI(nodes_urls=[], routing = "https://www.orfeus-eu.org/eidaws/routing/1/query?", **config) | ||
|
||
async with app.run_test() as pilot: | ||
|
||
button = app.query_one("#request-button") | ||
assert button is not None, "Button not found!" | ||
|
||
# Click the send button | ||
await pilot.click("#request-button") | ||
|
||
|
||
assert button.disabled is True, "Button should be disabled after click" | ||
|
||
await pilot.pause(2) # Waits for 500ms before checking the button | ||
|
||
assert button.disabled is False, "Button should be re-enabled after request found" | ||
|