Created
          December 9, 2013 10:57 
        
      - 
      
- 
        Save Madhuka/7870508 to your computer and use it in GitHub Desktop. 
    WSO2 Enterprise Store -Test Spec - for jaggery test framework
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //define store configuration test suites | |
| describe('TestSuite-StoreConfig', function () { | |
| var storConfig = require('../../config/store.json'); | |
| //configuration data for helping to test | |
| var testConfig = { | |
| "assetsUrlPrefix": "/assets", | |
| "extensionsUrlPrefix": "/extensions", | |
| "subscriptionsUrlPrefix": "/subscriptions", | |
| "tenantConfigs": "/_system/config/store/configs/store.json" | |
| }; | |
| //First test for store basic configuration data | |
| it('Checking store prefixs', function () { | |
| expect(storConfig.assetsUrlPrefix).toEqual(testConfig.assetsUrlPrefix); | |
| expect(storConfig.extensionsUrlPrefix).toEqual(testConfig.extensionsUrlPrefix); | |
| expect(storConfig.subscriptionsUrlPrefix).toEqual(testConfig.subscriptionsUrlPrefix); | |
| expect(storConfig.tenantConfigs).toEqual(testConfig.tenantConfigs); | |
| //need some thing to visible in store | |
| expect(storConfig.lifeCycleBehaviour.visibleIn.length).toBeGreaterThan(0); | |
| }); | |
| //Second test for store basic SSO configuration data | |
| it('Store sso configuration', function () { | |
| expect(storConfig.ssoConfiguration).toBeDefined(); | |
| expect(storConfig.ssoConfiguration.enabled).toBeDefined(); | |
| if (storConfig.ssoConfiguration.enabled) { | |
| expect(storConfig.ssoConfiguration.issuer).toBeDefined(); | |
| expect(storConfig.ssoConfiguration.identityProviderURL).toBeDefined(); | |
| expect(storConfig.ssoConfiguration.storeAcs).toBeDefined(); | |
| } | |
| }); | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //define store configuration test suites | |
| var store = require('../../modules/store.js'); | |
| describe('TestSuite-ModuleSotre', function () { | |
| //configuration data for helping to test | |
| it('Store checking', function () { | |
| expect(store).toBeDefined(); | |
| expect(store.SUPER_TENANT).toBe(-1234); | |
| expect(store.STORE_CONFIG_PATH).toBe('/_system/config/store/configs/store.json'); | |
| expect(store.ASSET_MANAGERS).toBeDefined(); | |
| expect(store.ASSET_MANAGERS).toBe('asset.managers'); | |
| expect(store.Store).toBeDefined(); | |
| }); | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //define store configuration test suites | |
| describe('TestSuite-StoreUser', function () { | |
| mod = require('store'), | |
| user = mod.user, | |
| it('Store user checking', function () { | |
| expect(user).toBeDefined(); | |
| expect(user.USER_OPTIONS).toBe('server.user.options'); | |
| expect(user.register).toBeDefined(); | |
| expect(user.privateRole).toBeDefined(); | |
| expect(user.userExists).toBeDefined(); | |
| expect(user.userSpace).toBeDefined(); | |
| }); | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | describe('TestSuite-Store', function () { | |
| var server = require('store').server; | |
| it('Checking store defined', function () { | |
| expect(server.init).toBeDefined(); | |
| expect(server.userManager).toBeDefined(); | |
| expect(server.anonRegistry).toBeDefined(); | |
| }); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment