2024-07-28 11:30:32 +02:00
|
|
|
(defpackage ml-sbt/tests/btn
|
2023-07-28 15:43:04 +02:00
|
|
|
(:use
|
|
|
|
:cl
|
2024-07-28 11:30:32 +02:00
|
|
|
:ml-sbt/btn
|
2024-03-30 09:17:04 +01:00
|
|
|
:rove))
|
2023-07-28 15:43:04 +02:00
|
|
|
|
2024-07-28 11:30:32 +02:00
|
|
|
(in-package :ml-sbt/btn)
|
2023-07-28 15:43:04 +02:00
|
|
|
|
|
|
|
(deftest test-btn-macro
|
|
|
|
(testing "Testing btn macro"
|
2023-08-09 15:06:10 +02:00
|
|
|
(let ((result (spinneret:with-html-string (btn (:color "primary") "foo"))))
|
2023-09-01 18:39:05 +02:00
|
|
|
(ok (search "class=\"btn btn-primary\"" result))
|
|
|
|
(ok (search "type=button" result)))))
|
2023-07-28 15:43:04 +02:00
|
|
|
|
2023-08-15 19:30:01 +02:00
|
|
|
(deftest test-btn-macro-with-type
|
|
|
|
(testing "Testing btn macro with type"
|
|
|
|
(let ((result (spinneret:with-html-string (btn (:type "submit" :color "primary") "foo"))))
|
|
|
|
(ok (search "class=\"btn btn-primary\"" result))
|
|
|
|
(ok (search "type=submit" result)))))
|
|
|
|
|
2023-09-01 18:39:05 +02:00
|
|
|
(deftest test-btn-macro-with-id
|
|
|
|
(testing "Testing btn macro with id"
|
|
|
|
(let ((result (spinneret:with-html-string (btn (:id "submit" :color "primary") "foo"))))
|
|
|
|
(ok (search "class=\"btn btn-primary\"" result))
|
|
|
|
(ok (search "id=submit" result)))))
|
|
|
|
|
2023-07-28 15:43:04 +02:00
|
|
|
(deftest test-btn-primary
|
|
|
|
(testing "Testing btn primary"
|
2023-09-01 18:39:05 +02:00
|
|
|
(let ((result (spinneret:with-html-string (btn-primary nil "foo"))))
|
|
|
|
(ok (search "class=\"btn btn-primary\"" result))
|
|
|
|
(ok (search "type=button" result)))))
|
2023-07-28 15:43:04 +02:00
|
|
|
|
|
|
|
(deftest test-btn-outline-primary
|
2023-09-01 18:39:05 +02:00
|
|
|
(testing "Testing btn outline primary without additional keywords"
|
2023-08-15 19:30:01 +02:00
|
|
|
(let ((result (spinneret:with-html-string (btn-outline-primary () "foo"))))
|
2023-09-01 18:39:05 +02:00
|
|
|
(ok (search "class=\"btn btn-outline-primary\"" result))
|
|
|
|
(ok (search "type=button" result)))))
|
2023-08-15 19:30:01 +02:00
|
|
|
|
|
|
|
(deftest test-btn-outline-primary-with-type-submit
|
|
|
|
(testing "Testing btn outline primary with type submit"
|
|
|
|
(let ((result (spinneret:with-html-string (btn-outline-primary (:type "submit") "foo"))))
|
|
|
|
(ok (search "class=\"btn btn-outline-primary\"" result))
|
|
|
|
(ok (search "type=submit" result)))))
|
2023-09-01 18:39:05 +02:00
|
|
|
|
|
|
|
(deftest test-btn-outline-primary-with-id
|
|
|
|
(testing "Testing btn outline primary with id example"
|
|
|
|
(let ((result (spinneret:with-html-string (btn-outline-primary (:id "example") "foo"))))
|
|
|
|
(ok (search "class=\"btn btn-outline-primary\"" result))
|
|
|
|
(ok (search "type=button" result))
|
|
|
|
(ok (search "id=example" result)))))
|