From 32ddfa7c0b9d559b528ab4ae527e22b3ac993f09 Mon Sep 17 00:00:00 2001 From: Iris Scholten Date: Fri, 23 Mar 2018 17:42:39 -0700 Subject: [PATCH] add tests for GraphOptionsFixFirstColumn --- .../GraphOptionsFixFirstColumn.test.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ui/test/dashboards/components/GraphOptionsFixFirstColumn.test.tsx b/ui/test/dashboards/components/GraphOptionsFixFirstColumn.test.tsx index e4da2b42c6..36c36ddd1a 100644 --- a/ui/test/dashboards/components/GraphOptionsFixFirstColumn.test.tsx +++ b/ui/test/dashboards/components/GraphOptionsFixFirstColumn.test.tsx @@ -26,5 +26,23 @@ describe('Dashboards.Components.GraphOptionsFixFirstColumn', () => { expect(checkbox.exists()).toBe(true) expect(checkbox.prop('type')).toBe('checkbox') }) + + describe('if fixed is true', () => { + it('input is checked', () => { + const {wrapper} = setup() + const checkbox = wrapper.find('input') + + expect(checkbox.prop('checked')).toBe(true) + }) + }) + + describe('if fixed is false', () => { + it('input is not checked', () => { + const {wrapper} = setup({fixed: false}) + const checkbox = wrapper.find('input') + + expect(checkbox.prop('checked')).toBe(false) + }) + }) }) })