diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-08-11 23:06:57 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-08-11 23:08:16 +0530 |
| commit | ca80dee29014298bd8a1a82bd0418cc073a76316 (patch) | |
| tree | 70607817c0b27738eeb91b954aa5656adc2a311e /tests/fixtures | |
| parent | b4548ce257c301154a39f5296387c2a72c552e70 (diff) | |
| download | css-everything-ca80dee29014298bd8a1a82bd0418cc073a76316.tar.gz css-everything-ca80dee29014298bd8a1a82bd0418cc073a76316.zip | |
test: adds test for simple signup page example
Diffstat (limited to '')
| -rw-r--r-- | tests/fixtures/signup/index.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/fixtures/signup/index.html b/tests/fixtures/signup/index.html new file mode 100644 index 0000000..df69508 --- /dev/null +++ b/tests/fixtures/signup/index.html @@ -0,0 +1,47 @@ +<html lang="en"> + <head> + <title>Register page</title> + <meta charset="UTF-8" /> + <style> + body { + --cssx-children: button#show-form-btn form#signup-form; + } + + #show-form-btn::before { + content: 'Show form'; + } + #show-form-btn { + --cssx-on-click: add-class(signup-form, 'visible') + add-class(show-form-btn, 'active'); + } + + #signup-form { + display: none; + + --cssx-children: input#email input#password button#submit-btn; + + --cssx-on-submit: prevent-default() add-class(signup-form, 'submitting') + delay(0.2s) request('http://example.com/submit/api', POST) + remove-class(signup-form, 'submitting') + add-class(signup-form, 'submitted'); + } + #signup-form.visible { + display: block; + } + + #email { + --cssx-on-mount: set-attr('name', 'email') + set-attr('data-testid', 'email'); + } + #password { + --cssx-on-mount: set-attr('name', 'password') + set-attr('data-testid', 'password'); + } + #submit-btn { + --cssx-on-mount: set-attr('type', 'submit'); + --cssx-text: Submit; + } + </style> + </head> + <body></body> +</html> |
