Browse Source

test(js): Fix partially incorrect `<OrganizationContext>` test (#15364)

This was incorrect as well as flaky.
Billy Vong 5 years ago
parent
commit
f87a9fdb3b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      tests/js/spec/views/organizationContext.spec.jsx

+ 3 - 3
tests/js/spec/views/organizationContext.spec.jsx

@@ -173,7 +173,7 @@ describe('OrganizationContext', function() {
 
     wrapper = createWrapper({
       useLastOrganization: true,
-      params: {orgId: 'foo'},
+      params: {orgId: ''},
       organizationsLoading: true,
       organizations: [],
     });
@@ -187,9 +187,9 @@ describe('OrganizationContext', function() {
         TestStubs.Organization({slug: 'bar'}),
       ],
     });
-    wrapper.update();
 
-    await tick();
+    await tick(); // action to start fetch org
+    await tick(); // action after successfully fetching org
     wrapper.update();
     expect(wrapper.find('LoadingIndicator')).toHaveLength(0);