-
-
Notifications
You must be signed in to change notification settings - Fork 622
Add markdown preview pane with per-result content types #4529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
3af13af
ea78b53
38c27fd
1504177
20c7c62
7092ad2
a74b87a
fc0b8e9
1ade524
40d2220
8670a61
945d5ec
560c380
7ba1dbd
e7ae6d7
4ffa212
d4789b1
8636fb2
b0656cd
57d5940
61cfd30
4a3a1c2
99180dd
f826c36
6db5575
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| using Flow.Launcher.Resources.Controls; | ||
| using NUnit.Framework; | ||
| using NUnit.Framework.Legacy; | ||
|
|
||
| namespace Flow.Launcher.Test | ||
| { | ||
| [TestFixture] | ||
| internal class CodeHighlightThemeTest | ||
| { | ||
| private string _savedThemeName; | ||
|
|
||
| [SetUp] | ||
| public void SetUp() => _savedThemeName = PreviewMarkdownScrollViewer.ActiveThemeName; | ||
|
|
||
| [TearDown] | ||
| public void TearDown() => PreviewMarkdownScrollViewer.ApplyCodeHighlightTheme(_savedThemeName, isDark: true); | ||
|
|
||
| [Test] | ||
| public void GivenAutoSetting_WhenAppIsDark_ThenActiveThemeIsADarkTheme() | ||
| { | ||
| PreviewMarkdownScrollViewer.ApplyCodeHighlightTheme("Auto", isDark: true); | ||
|
|
||
| ClassicAssert.AreEqual("VS Code Dark+", PreviewMarkdownScrollViewer.ActiveThemeName); | ||
| } | ||
|
|
||
| [Test] | ||
| public void GivenAutoSetting_WhenAppIsLight_ThenActiveThemeIsALightTheme() | ||
| { | ||
| PreviewMarkdownScrollViewer.ApplyCodeHighlightTheme("Auto", isDark: false); | ||
|
|
||
| ClassicAssert.AreEqual("VS Code Light", PreviewMarkdownScrollViewer.ActiveThemeName); | ||
| } | ||
|
|
||
| [Test] | ||
| public void GivenExplicitTheme_WhenApplied_ThenActiveThemeMatchesRegardlessOfAppScheme() | ||
| { | ||
| PreviewMarkdownScrollViewer.ApplyCodeHighlightTheme("OneDark", isDark: false); | ||
|
|
||
| ClassicAssert.AreEqual("One Dark", PreviewMarkdownScrollViewer.ActiveThemeName); | ||
| } | ||
|
|
||
| [Test] | ||
| public void GivenEmptySetting_WhenApplied_ThenFallsBackToAutoBehaviour() | ||
| { | ||
| PreviewMarkdownScrollViewer.ApplyCodeHighlightTheme("", isDark: false); | ||
|
|
||
| ClassicAssert.AreEqual("VS Code Light", PreviewMarkdownScrollViewer.ActiveThemeName); | ||
|
Comment on lines
+18
to
+47
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Reset the global theme between tests. Each test mutates 🤖 Prompt for AI Agents
Comment on lines
+42
to
+47
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add a real unknown-setting case here. The test name and the resolver contract both mention "unknown or empty", but this only exercises 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| [Test] | ||
| public void GivenUnrecognisedSetting_WhenApplied_ThenFallsBackToAutoBehaviour() | ||
| { | ||
| PreviewMarkdownScrollViewer.ApplyCodeHighlightTheme("BogusTheme", isDark: true); | ||
|
|
||
| ClassicAssert.AreEqual("VS Code Dark+", PreviewMarkdownScrollViewer.ActiveThemeName); | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.