mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-08-17 00:31:42 +02:00
.github
.tx
appinfo
bin
css
docs
img
js
admin
app
controller
directive
filter
gui
plugin
service
tests
e2e
static
unit
controller
AppControllerSpec.js
ContentControllerSpec.js
ExploreControllerSpec.js
NavigationControllerSpec.js
SettingsControllerSpec.js
filter
service
stubs
.jshintignore
.jshintrc
README.md
gulpfile.js
karma.conf.js
package-lock.json
package.json
protractor.conf.js
l10n
lib
screenshots
src
templates
tests
.editorconfig
.eslintrc.js
.gitignore
.gitmodules
.mailmap
AUTHORS.md
CHANGELOG.md
CONTRIBUTING.md
COPYING
Makefile
README.md
babel.config.js
composer.json
composer.lock
mkdocs.yml
package-lock.json
package.json
phpstan.neon.dist
phpunit.xml
stylelint.config.js
webpack.config.js
57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
/**
|
|
* Nextcloud - News
|
|
*
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
* later. See the COPYING file.
|
|
*
|
|
* @author Bernhard Posselt <dev@bernhard-posselt.com>
|
|
* @copyright Bernhard Posselt 2014
|
|
*/
|
|
describe('AppController', function () {
|
|
'use strict';
|
|
|
|
var controller,
|
|
location;
|
|
|
|
beforeEach(module('News', function ($provide) {
|
|
$provide.value('BASE_URL', 'base');
|
|
}));
|
|
|
|
beforeEach(inject(function ($controller) {
|
|
location = {
|
|
path: jasmine.createSpy('path')
|
|
};
|
|
|
|
controller = $controller('AppController', {
|
|
$location: location
|
|
});
|
|
}));
|
|
|
|
|
|
it('should expose Loading', inject(function (Loading) {
|
|
expect(controller.loading).toBe(Loading);
|
|
}));
|
|
|
|
|
|
it('should expose set firstrun if no feeds and folders', function () {
|
|
expect(controller.isFirstRun()).toBe(true);
|
|
});
|
|
|
|
|
|
it('should expose set firstrun if feeds', inject(function (FeedResource) {
|
|
FeedResource.add({url: 'test'});
|
|
|
|
expect(controller.isFirstRun()).toBe(false);
|
|
}));
|
|
|
|
|
|
it('should expose set firstrun if folders', inject(
|
|
function (FolderResource) {
|
|
FolderResource.add({name: 'test'});
|
|
|
|
expect(controller.isFirstRun()).toBe(false);
|
|
expect(location.path).not.toHaveBeenCalled();
|
|
}));
|
|
|
|
});
|