mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 02:28:09 +00:00 
			
		
		
		
	 8835514e76
			
		
	
	8835514e76
	
	
	
		
			
			Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com> Co-authored-by: clairebontempo@gmail.com <clairebontempo@gmail.com> Co-authored-by: Angel Garbarino <angel@hashicorp.com>
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { click, fillIn, findAll, currentURL, visit, settled, waitUntil } from '@ember/test-helpers';
 | |
| 
 | |
| export const disableReplication = async (type, assert) => {
 | |
|   // disable performance replication
 | |
|   await visit(`/vault/replication/${type}`);
 | |
| 
 | |
|   if (findAll('[data-test-replication-link="manage"]').length) {
 | |
|     await click('[data-test-replication-link="manage"]');
 | |
| 
 | |
|     await click('[data-test-disable-replication] button');
 | |
| 
 | |
|     const typeDisplay = type === 'dr' ? 'Disaster Recovery' : 'Performance';
 | |
|     await fillIn('[data-test-confirmation-modal-input="Disable Replication?"]', typeDisplay);
 | |
|     await click('[data-test-confirm-button]');
 | |
|     await settled(); // eslint-disable-line
 | |
| 
 | |
|     if (assert) {
 | |
|       // bypassing for now -- remove if tests pass reliably
 | |
|       // assert.strictEqual(
 | |
|       //   flash.latestMessage,
 | |
|       //   'This cluster is having replication disabled. Vault will be unavailable for a brief period and will resume service shortly.',
 | |
|       //   'renders info flash when disabled'
 | |
|       // );
 | |
|       assert.ok(
 | |
|         await waitUntil(() => currentURL() === '/vault/replication'),
 | |
|         'redirects to the replication page'
 | |
|       );
 | |
|     }
 | |
|     await settled();
 | |
|   }
 | |
| };
 |