ccaominh commented on a change in pull request #9891:
URL: https://github.com/apache/druid/pull/9891#discussion_r428157803



##########
File path: web-console/src/components/rule-editor/rule-editor.spec.tsx
##########
@@ -36,4 +36,64 @@ describe('rule editor', () => {
     const { container } = render(ruleEditor);
     expect(container.firstChild).toMatchSnapshot();
   });
+
+  it('matches snapshot with non existing tier in rule', () => {
+    const ruleEditor = (
+      <RuleEditor
+        rule={{
+          type: 'loadByInterval',
+          period: '2010-01-01/2015-01-01',
+          tieredReplicants: { nonexist: 2 },
+        }}
+        tiers={['test1', 'test2', 'test3']}
+        onChange={() => {}}
+        onDelete={() => {}}
+        moveUp={null}
+        moveDown={null}
+      />
+    );
+    const { container } = render(ruleEditor);
+    expect(container.firstChild).toMatchSnapshot();
+  });
+
+  it('matches snapshot with existing tier in rule', () => {
+    const ruleEditor = (
+      <RuleEditor
+        rule={{
+          type: 'loadByInterval',
+          period: '2010-01-01/2015-01-01',
+          tieredReplicants: { test1: 2 },
+        }}
+        tiers={['test1', 'test2', 'test3']}
+        onChange={() => {}}
+        onDelete={() => {}}
+        moveUp={null}
+        moveDown={null}
+      />
+    );
+    const { container } = render(ruleEditor);
+    expect(container.firstChild).toMatchSnapshot();
+  });
+
+    it('matches snapshot with existing tier and non existing tier in rule', () 
=> {
+      const ruleEditor = (
+        <RuleEditor
+          rule={{
+            type: 'loadByInterval',
+            period: '2010-01-01/2015-01-01',
+            tieredReplicants: {
+              test1: 2,
+              nonexist: 1,
+            },
+          }}
+          tiers={['test1', 'test2', 'test3']}
+          onChange={() => {}}
+          onDelete={() => {}}
+          moveUp={null}
+          moveDown={null}
+        />
+      );
+      const { container } = render(ruleEditor);
+      expect(container.firstChild).toMatchSnapshot();
+    });

Review comment:
       CI is flagging the extra indentation for this test
   https://travis-ci.org/github/apache/druid/jobs/689087087#L411




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to