Compare commits

...

12 Commits

Author SHA1 Message Date
David Tsay
0dabb29b41 Merge branch 'master' into tab-keep-alive 2021-10-28 19:04:25 -07:00
Jamie Vigliotta
5545b24472 Merge branch 'tab-keep-alive' of https://github.com/nasa/openmct into tab-keep-alive
Merge'n updates
2021-10-28 17:37:45 -07:00
Jamie Vigliotta
1380bd9c80 more clear test descriptions 2021-10-28 17:37:39 -07:00
Jamie V
fa49781d6b Merge branch 'master' into tab-keep-alive 2021-10-28 09:48:21 -07:00
Jamie V
871cf09afd Merge branch 'master' into tab-keep-alive 2021-10-26 15:25:49 -07:00
Jamie Vigliotta
e8971357d8 removing unneccesary testing code 2021-10-26 11:33:27 -07:00
Jamie Vigliotta
b59a966724 adding back some code removed during updates 2021-10-26 11:32:50 -07:00
Jamie Vigliotta
9254c8cb4d Merge branch 'tab-keep-alive' of https://github.com/nasa/openmct into tab-keep-alive
merge'n master
2021-10-26 11:30:57 -07:00
Jamie Vigliotta
29deaf6a9c testing for hidden tabs not loading views 2021-10-26 11:30:46 -07:00
Jamie V
9caa3e47ff Merge branch 'master' into tab-keep-alive 2021-10-25 13:23:23 -07:00
Jamie Vigliotta
c228855e27 Merge branch 'master' of https://github.com/nasa/openmct 2021-10-25 13:09:10 -07:00
Jamie Vigliotta
42cacac8e8 before adding a tab to the loaded object, checking if keep alive, if not only one tab at a time will be "loaded" 2021-10-25 13:08:59 -07:00
2 changed files with 29 additions and 0 deletions

View File

@@ -152,6 +152,10 @@ export default {
},
methods: {
addTabToLoaded(tab) {
if (!this.internalDomainObject.keep_alive) {
this.loadedTabs = {};
}
this.loadedTabs[tab.keyString] = true;
},
setCurrentTabByIndex(index) {

View File

@@ -173,9 +173,34 @@ describe('the plugin', function () {
return Vue.nextTick();
});
afterEach(() => {
count = 0;
});
it ('renders a tab for each item', () => {
let tabEls = element.querySelectorAll('.js-tab');
expect(tabEls.length).toEqual(2);
});
describe('with domainObject.keep_alive set to', () => {
it ('true, will keep all views loaded, regardless of current tab view', () => {
let tabViewEls = element.querySelectorAll('.c-tabs-view__object');
expect(tabViewEls.length).toEqual(2);
});
it ('false, will only keep the current tab view loaded', async () => {
testViewObject.keep_alive = false;
await Vue.nextTick();
let tabViewEls = element.querySelectorAll('.c-tabs-view__object');
expect(tabViewEls.length).toEqual(1);
});
});
});
});