mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-14 15:24:00 -04:00
30 lines
1.1 KiB
QML
30 lines
1.1 KiB
QML
import QtQuick
|
|
import QtTest
|
|
import "../../Modules/DBar/Widgets/KeyboardLayoutLabels.js" as KeyboardLayoutLabels
|
|
|
|
TestCase {
|
|
name: "KeyboardLayoutLabels"
|
|
|
|
readonly property var validVariants: ["US", "UK", "GB", "AZERTY", "QWERTY", "Dvorak", "Colemak", "Mac", "Intl", "International"]
|
|
|
|
function test_overrideReplacesRawHyprlandCompactLabel() {
|
|
compare(KeyboardLayoutLabels.displayLabel("am-phonetic-alt", true, true, validVariants, {
|
|
"am-phonetic-alt": "am"
|
|
}), "am");
|
|
}
|
|
|
|
function test_overrideKeyIsTheComputedLabelNotTheRawInput() {
|
|
const label = KeyboardLayoutLabels.displayLabel("English (US)", true, false, validVariants, {});
|
|
compare(KeyboardLayoutLabels.displayLabel("English (US)", true, false, validVariants, {
|
|
[label]: "en"
|
|
}), "en");
|
|
}
|
|
|
|
function test_verticalLabelOverrideIsKeyedIndependentlyFromHorizontal() {
|
|
const label = KeyboardLayoutLabels.verticalLabel("am-phonetic-alt", {});
|
|
compare(KeyboardLayoutLabels.verticalLabel("am-phonetic-alt", {
|
|
[label]: "hy"
|
|
}), "hy");
|
|
}
|
|
}
|