Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nicolas Frandeboeuf
kresus
Commits
7d2875c8
Commit
7d2875c8
authored
May 09, 2017
by
ZeHiro
Committed by
Benjamin Bouvier
May 09, 2017
Browse files
Added teste for isWeboobInstalled getter
parent
c5a720cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test-is-weboob-installed.js
0 → 100644
View file @
7d2875c8
import
should
from
'
should
'
;
import
{
get
}
from
'
../client/store
'
;
import
{
MIN_WEBOOB_VERSION
}
from
'
../client/helpers
'
;
import
{
normalizeVersion
}
from
'
../client/helpers
'
;
import
semver
from
'
semver
'
;
describe
(
'
isWeboobInstalled
'
,
()
=>
{
describe
(
'
should return false when
'
,
()
=>
{
it
(
"
'weboob-installed' set to false
"
,
()
=>
{
let
state
=
{
settings
:
{
map
:
{
'
weboob-installed
'
:
'
false
'
}
}
};
get
.
isWeboobInstalled
(
state
).
should
.
equal
(
false
);
});
it
(
"
'weboob-installed' set to true and 'weboob-version' < MIN_WEBOOB_VERSION
"
,
()
=>
{
let
state
=
{
settings
:
{
map
:
{
'
weboob-installed
'
:
'
true
'
,
'
weboob-version
'
:
'
1.0.0
'
,
}
}
};
get
.
isWeboobInstalled
(
state
).
should
.
equal
(
false
);
});
it
(
"
'weboob-installed' set to true and 'weboob-version' === 0.h
"
,
()
=>
{
let
state
=
{
settings
:
{
map
:
{
'
weboob-installed
'
:
'
true
'
,
'
weboob-version
'
:
'
0.h
'
,
}
}
};
get
.
isWeboobInstalled
(
state
).
should
.
equal
(
false
);
});
});
describe
(
'
should return true when
'
,
()
=>
{
it
(
"
'weboob-installed' set to true and 'weboob-version' === MIN_WEBOOB_VERSION
"
,
()
=>
{
let
state
=
{
settings
:
{
map
:
{
'
weboob-installed
'
:
'
true
'
,
'
weboob-version
'
:
MIN_WEBOOB_VERSION
,
}
}
};
get
.
isWeboobInstalled
(
state
).
should
.
equal
(
true
);
});
it
(
"
'weboob-installed' set to true and MIN_WEBOOB_VERSION <= 'weboob-version'
"
,
()
=>
{
let
state
=
{
settings
:
{
map
:
{
'
weboob-installed
'
:
'
true
'
,
'
weboob-version
'
:
semver
.
inc
(
normalizeVersion
(
MIN_WEBOOB_VERSION
),
'
minor
'
),
}
}
};
get
.
isWeboobInstalled
(
state
).
should
.
equal
(
true
);
});
});
})
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment