describe('my-app App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); expect(page.getParagraphText()).toEqual('Welcome to app!'); }); });
it('should overwrite plugin config munge for every conflicting config.xml config munge', function () { install_plugin(editconfigplugin_two); const platformJson = PlatformJson.load(plugins_dir, 'android'); platformJson.addInstalledPluginToPrepareQueue('org.test.editconfigtest_two', {}, true, true); const munger = new configChanges.PlatformMunger('android', temp, platformJson, pluginInfoProvider); munger.process(plugins_dir); munger.add_config_changes(cfg, true).save_all(); const am_xml = new et.ElementTree(et.XML(fs.readFileSync(path.join(temp, 'AndroidManifest.xml'), 'utf-8'))); const sdk = am_xml.find('./uses-sdk'); expect(sdk).toBeDefined(); expect(sdk.attrib['android:targetSdkVersion']).toEqual('24'); });
it('Checking onOperator() with 4 bits per var', () => { let bpv = OConfig.codeBitsPerVar; OConfig.codeBitsPerVar = 4; let ops1 = new OperatorsDos([1], [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], org); expect(ops1.onOperator(0x04ffffff, 0)).toEqual(1); //v15=v15<=v15 expect(ops1.vars).toEqual([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1]); expect(ops1.onOperator(0x046ff0ff, 0)).toEqual(1); //v6=v15+v15 expect(ops1.vars).toEqual([0,1,2,3,4,5,2,7,8,9,10,11,12,13,14,1]); OConfig.codeBitsPerVar = bpv; ops1.destroy(); });
// testing the "after" attribute of the <config-file> tag in config.xml it('should append new children to XML document tree in the correct order', function () { const configfile_cfg = new ConfigParser(configfile_xml); const platformJson = PlatformJson.load(plugins_dir, 'android'); const munger = new configChanges.PlatformMunger('android', temp, platformJson, pluginInfoProvider); munger.add_config_changes(configfile_cfg, true).save_all(); const am_file = fs.readFileSync(path.join(temp, 'AndroidManifest.xml'), 'utf-8'); expect(am_file.indexOf('android:name="zoo"')).toBeLessThan(am_file.indexOf('android:name="com.foo.Bar"')); });
it('Test 012 : should remove and mkdir when source is a directory and target is a file', function () { const updated = FileUpdater.updatePathWithStats( testSourceDir, mockDirStats(), testTargetDir, mockFileStats(now)); expect(updated).toBe(true); expect(mockFs.cpPaths.length).toBe(0); expect(mockFs.rmPaths.length).toBe(1); expect(mockFs.mkdirPaths.length).toBe(1); expect(mockFs.rmPaths[0]).toBe(testTargetDir); expect(mockFs.mkdirPaths[0]).toBe(testTargetDir); });
describe('QuickStart E2E Tests', function () { let expectedMsg = 'Hello Angular'; beforeEach(function () { browser.get(''); }); it('should display: ' + expectedMsg, function () { expect(element(by.css('h1')).getText()).toEqual(expectedMsg); }); });
it('Test 010 : should copy when a file exists at source and not at target', function () { const updated = FileUpdater.updatePathWithStats( testSourceFile, mockFileStats(now), testTargetFile, null); expect(updated).toBe(true); expect(mockFs.cpPaths.length).toBe(1); expect(mockFs.rmPaths.length).toBe(0); expect(mockFs.cpPaths[0]).toEqual([testSourceFile, testTargetFile]); });
it('Test 020 : should call graftXMLOverwrite for every new config munge with mode \'overwrite\' it introduces', function () { install_plugin(editconfigplugin); const platformJson = PlatformJson.load(plugins_dir, 'android'); platformJson.addInstalledPluginToPrepareQueue('org.test.editconfigtest', {}); const spy = spyOn(xml_helpers, 'graftXMLOverwrite').and.returnValue(true); const munger = new configChanges.PlatformMunger('android', temp, platformJson, pluginInfoProvider); munger.process(plugins_dir); expect(spy.calls.count()).toEqual(1); expect(spy.calls.argsFor(0)[2]).toEqual('/manifest/application/activity'); });
describe('Checks getBits() method', () => { it('Checking getBits() method', () => { Num.init(0xff); expect(Num.getBits(0xabffffff, 0, 8)).toEqual(0xab); expect(Num.getBits(0xabffffff, 0, 4)).toEqual(0xa); expect(Num.getBits(0xabffffff, 4, 4)).toEqual(0xb); expect(Num.getBits(0xabfbffff, 12, 2)).toEqual(0x2); expect(Num.getBits(0xabcdffff, 8, 8)).toEqual(0xcd); expect(Num.getBits(0xabcdffff, 16, 8)).toEqual(0xff); }); });
describe('CoinService', () => { beforeEach(() => { TestBed.configureTestingModule({ providers: [CoinService] }); }); it('should be created', inject([CoinService], (service: CoinService) => { expect(service).toBeTruthy(); })); });
describe('workspace-project App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); expect(page.getParagraphText()).toEqual('Welcome to app!'); }); });
describe('workspace-project App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); expect(page.getParagraphText()).toEqual('Welcome to app!'); }); });
describe('OrderItemService', () => { beforeEach(() => { TestBed.configureTestingModule({ providers: [OrderItemService] }); }); it('should be created', inject([OrderItemService], (service: OrderItemService) => { expect(service).toBeTruthy(); })); });
describe('ProductServiceService', () => { beforeEach(() => { TestBed.configureTestingModule({ providers: [ProductServiceService] }); }); it('should be created', inject([ProductServiceService], (service: ProductServiceService) => { expect(service).toBeTruthy(); })); });