diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d4411ef17..d544bd524 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -61,6 +61,7 @@ set(WIDGET_TEST
testcases/widgets/ut_dipv4lineedit.cpp
testcases/widgets/ut_dkeysequenceedit.cpp
testcases/widgets/ut_dlabel.cpp
+ testcases/widgets/ut_dlicensedialog.cpp
testcases/widgets/ut_dlineedit.cpp
testcases/widgets/ut_dlistview.cpp
testcases/widgets/ut_dloadingindicator.cpp
@@ -92,6 +93,7 @@ set(WIDGET_TEST
testcases/widgets/ut_dstyleoption.cpp
testcases/widgets/ut_dsuggestbutton.cpp
testcases/widgets/ut_dswitchbutton.cpp
+ testcases/widgets/ut_dswitchlineexpand.cpp
testcases/widgets/ut_dtabbar.cpp
testcases/widgets/ut_dtextedit.cpp
testcases/widgets/ut_dtickeffect.cpp
diff --git a/tests/data.qrc b/tests/data.qrc
index 68b15b181..8638b1165 100644
--- a/tests/data.qrc
+++ b/tests/data.qrc
@@ -1,5 +1,6 @@
data/titlebar-settings.json
+ data/example-license.json
diff --git a/tests/data/example-license.json b/tests/data/example-license.json
new file mode 100644
index 000000000..bbfabd017
--- /dev/null
+++ b/tests/data/example-license.json
@@ -0,0 +1,32 @@
+[
+ {
+ "name": "pkg-config",
+ "version": "",
+ "copyright": "NOASSERTION",
+ "license": "MIT"
+ },
+ {
+ "name": "lshw",
+ "version": "",
+ "copyright": "NOASSERTION",
+ "license": "GPL-2"
+ },
+ {
+ "name": "debhelper",
+ "version": "",
+ "copyright": "NOASSERTION",
+ "license": "GPL-2"
+ },
+ {
+ "name": "pkg-config",
+ "version": "",
+ "copyright": "NOASSERTION",
+ "license": "MIT"
+ },
+ {
+ "name": "debhelper",
+ "version": "",
+ "copyright": "NOASSERTION",
+ "license": "GPL-2"
+ }
+]
diff --git a/tests/testcases/widgets/ut_dlicensedialog.cpp b/tests/testcases/widgets/ut_dlicensedialog.cpp
new file mode 100644
index 000000000..9231a3495
--- /dev/null
+++ b/tests/testcases/widgets/ut_dlicensedialog.cpp
@@ -0,0 +1,40 @@
+// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: LGPL-3.0-or-later
+
+#include
+#include "dlicensedialog.h"
+DWIDGET_USE_NAMESPACE
+class ut_DLicenseDialog : public testing::Test
+{
+protected:
+ void SetUp() override
+ {
+ target = new DLicenseDialog();
+ }
+ void TearDown() override
+ {
+ if (target) {
+ delete target;
+ target = nullptr;
+ }
+ }
+ DLicenseDialog *target = nullptr;
+
+};
+
+TEST_F(ut_DLicenseDialog, setFile)
+{
+ target->setFile(":/data/example-license.json");
+ target->load();
+ ASSERT_TRUE(target->isValid());
+};
+
+
+
+TEST_F(ut_DLicenseDialog, isValid)
+{
+ target->setFile("XXXXXXX");
+ target->load();
+ ASSERT_FALSE(target->isValid());
+};
diff --git a/tests/testcases/widgets/ut_dswitchlineexpand.cpp b/tests/testcases/widgets/ut_dswitchlineexpand.cpp
new file mode 100644
index 000000000..b20855a87
--- /dev/null
+++ b/tests/testcases/widgets/ut_dswitchlineexpand.cpp
@@ -0,0 +1,60 @@
+// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: LGPL-3.0-or-later
+
+#include
+#include
+
+#include "dswitchlineexpand.h"
+
+DWIDGET_USE_NAMESPACE
+
+class ut_DSwitchLineExpand : public testing::Test
+{
+protected:
+ void SetUp() override;
+ void TearDown() override;
+ DSwitchLineExpand *target = nullptr;
+ QWidget *widget = nullptr;
+};
+
+void ut_DSwitchLineExpand::SetUp()
+{
+ widget = new QWidget;
+ target = new DSwitchLineExpand(widget);
+ widget->resize(300, 200);
+}
+
+void ut_DSwitchLineExpand::TearDown()
+{
+ widget->deleteLater();
+}
+
+TEST_F(ut_DSwitchLineExpand, testSetTitle)
+{
+ // 测试设置标题
+ target->setTitle("test");
+ ASSERT_EQ(target->m_headerLine->title(), "test");
+}
+
+TEST_F(ut_DSwitchLineExpand, testSetExpand)
+{
+ // 测试设置展开
+ target->setExpand(true);
+ ASSERT_TRUE(target->m_headerLine->m_switchButton->isChecked());
+ target->setExpand(false);
+ ASSERT_FALSE(target->m_headerLine->m_switchButton->isChecked());
+}
+
+TEST_F(ut_DSwitchLineExpand, testHeader)
+{
+ // 测试获取头部
+ ASSERT_EQ(target->header() , target->m_headerLine);
+}
+
+TEST_F(ut_DSwitchLineExpand, testResizeEvent)
+{
+ // 测试重置大小
+ target->resize(QSize(100, 100));
+ ASSERT_EQ(target->size(), QSize(100, 100));
+}