summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDevlin Junker <devlin.junker@gmail.com>2022-11-29 00:53:36 -1000
committerBenjamin Brahmer <info@b-brahmer.de>2022-12-06 14:57:20 +0100
commitf65769868bb826d4525025e92ab329f03f1c4962 (patch)
tree888c9804bbb059cc7945c7240cc1165a91bad449 /tests
parent28ead9da95449ad220b137c98e6e19a62e83f184 (diff)
working unit test for local computed state
Signed-off-by: Devlin Junker <devlin.junker@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/javascript/unit/components/Sidebar.spec.ts27
1 files changed, 19 insertions, 8 deletions
diff --git a/tests/javascript/unit/components/Sidebar.spec.ts b/tests/javascript/unit/components/Sidebar.spec.ts
index 5690aac08..c85bcd960 100644
--- a/tests/javascript/unit/components/Sidebar.spec.ts
+++ b/tests/javascript/unit/components/Sidebar.spec.ts
@@ -17,11 +17,12 @@ describe('Sidebar.vue', () => {
state: {
feeds: [],
folders: []
- }
+ },
+ dispatch: jest.fn()
}
}
})
- wrapper.vm.$store.dispatch = jest.fn();
+ // wrapper.vm.$store.
})
it('should initialize without showing AddFeed Component', () => {
@@ -51,15 +52,25 @@ describe('Sidebar.vue', () => {
expect(wrapper.vm.$data.showAddFeed).toBeFalsy
})
+ // TODO: A couple more tests here
+ it('should return top level nav (folders and feeds without folders)', () => {
+ let topLevelNav = (wrapper.vm.$options.computed?.topLevelNav as any).call({ $store: {
+ getters: {
+ feeds: [],
+ folders: []
+ }
+ }})
+
+ expect(topLevelNav).toEqual([])
+ })
+
+ // TODO: More Template Testing with https://test-utils.vuejs.org/guide/essentials/a-crash-course.html#adding-a-new-todo
+
afterEach(() => {
- jest.clearAllMocks();
+ jest.clearAllMocks()
});
describe('SideBar State', () => {
- // it('should return top level nav (folders and feeds without folders)', () => {
- // const navItems = (wrapper.vm.$options?.computed?.topLevelNav as any)({ feeds: [], folders: [] });
-
- // console.log(navItems)
- // })
+
})
})