Skip to content

Commit

Permalink
all tests running
Browse files Browse the repository at this point in the history
  • Loading branch information
Dierk Koenig committed Oct 17, 2024
1 parent 6f0d797 commit fca848e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/integration-test/groovy/rooms/CalculatorSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CalculatorSpec extends GebSpec {

void "Basic calculation"() {
when:
go '/?lang=en'
go '/static/GradeCalculator.html'
then:
title == "Grade Calculator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class InPlaceCalculatorSpec extends GebSpec {
def alertWasRaised = withAlert {
$("form").en = 0.9 // erroneous
$("form").exam = 3.0 // ok
$("input", type: "submit").click() // sadly needed as stimulus
$("input", type: "submit").click() // sadly needed as stimulus to trigger the onChange
}
then: "the in-place JS logic should kick in"
$("#en").attr('class') == "error"
Expand Down
34 changes: 16 additions & 18 deletions src/main/resources/public/GradeCalculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,28 @@
Grade Calculator
</title>
<style>
html {
font-family: system-ui;
}
form {
padding: 1em;
box-shadow: 1px 1px 2px black;
max-width: 60ch;
margin-inline: auto;
margin-top: 2em;
padding: 1em;
box-shadow: .2em .2em .5em lightgray;
max-width: 60ch;
margin-inline: auto;
margin-top: 2em;
display: grid;
grid-template-columns: max-content max-content;
gap: .5em 1em;
}


</style>
</head>
<body>
<form action="/calculator/calc" method="get">
<div class="row">
<label for="en">continuous assessment grade</label>
<input id="en" name="en" type="number">
</div>
<div class="row">
<label for="exam">final exam &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input id="exam" name="exam" type="number">
</div>
<div class="row">
<input type="submit">
</div>
<label for="en">continuous assessment grade</label>
<input id="en" name="en" type="number" step="0.1">
<label for="exam">final exam </label>
<input id="exam" name="exam" type="number" step="0.1">
<input type="submit">
</form>
</body>
</html>

0 comments on commit fca848e

Please sign in to comment.