Skip to content

Commit 764adb2

Browse files
committed
test: - Remove an out-of-date comment and clarify test names
1 parent 70396fe commit 764adb2

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

tests/Obsidian/Cache.test.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -755,21 +755,9 @@ describe('accessing links in file', function () {
755755

756756
const cachedMetadata: CachedMetadata = task.file.cachedMetadata;
757757

758-
/**
759-
* I am thinking of the following, to evantually make links accessible to users.
760-
* 1. Provide a class or interface called Link, with fields:
761-
* - displayText, e.g. "link_in_yaml"
762-
* - link, e.g. "link_in_yaml"
763-
* - original, e.g. "[[link_in_yaml]]"
764-
* 2. Add some getters that construct the relevant Link objects from cached metadata on demand, such as:
765-
* - task.file.linksInBody
766-
* - task.file.linksInFrontMatter
767-
* - task.file.allLinks
768-
* - task.links
769-
* 3. Consider the vocabulary - some dataview users talk about inlines and outlinks.
770-
* The above are all outlinks - but do we want to name them as such, to prepare
771-
* for if or when inlinks are also supported?
772-
*/
758+
// Usability note:
759+
// These tests are for visualising how Obsidian caches link properties.
760+
// See TasksFile and ListItem classes for accessing links via the Link class in Tasks cvode
773761

774762
it('see source', () => {
775763
expect(data.fileContents).toMatchInlineSnapshot(`
@@ -788,7 +776,7 @@ describe('accessing links in file', function () {
788776
`);
789777
});
790778

791-
it('should access links in frontmatter', () => {
779+
it('visualise raw links in frontmatter', () => {
792780
const frontMatterLinks = cachedMetadata['frontmatterLinks'];
793781
expect(frontMatterLinks).toBeDefined();
794782

@@ -804,7 +792,7 @@ describe('accessing links in file', function () {
804792
`);
805793
});
806794

807-
it('should access links in file body', () => {
795+
it('visualise raw links in file body', () => {
808796
const fileBodyLinks = cachedMetadata.links;
809797

810798
const originalLinkText = fileBodyLinks?.map((link) => link.original).join('\n');
@@ -836,7 +824,7 @@ describe('accessing links in file', function () {
836824
`);
837825
});
838826

839-
it('should access links in task line', () => {
827+
it('visualise raw links in task line', () => {
840828
const fileBodyLinks = cachedMetadata.links;
841829
const linksOnTask = fileBodyLinks?.filter((link) => link.position.start.line === task.lineNumber);
842830

0 commit comments

Comments
 (0)