Discover: sidebarFilter - fix Timeframes Clear button.
This commit is contained in:
@@ -191,17 +191,57 @@ describe('Save Log and Filter', ()=>{
|
|||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
|
||||||
it('Trace', () => {
|
// it('Trace', () => {
|
||||||
// select radio
|
// // select radio
|
||||||
cy.get('input#Trace2').check({ force: true }); // 選取 Radio 'Trace'
|
// cy.get('input#Trace2').check({ force: true }); // 選取 Radio 'Trace'
|
||||||
cy.wait(3000);
|
// cy.wait(3000);
|
||||||
|
|
||||||
// click on Trace Number to show a table
|
// // click on Trace Number to show a table
|
||||||
cy.contains('td', '#1').click();
|
// cy.contains('td', '#1').click();
|
||||||
cy.wait(1000);
|
// cy.wait(1000);
|
||||||
cy.get('#cyTrace').scrollIntoView().should('be.visible'); // 視窗滾到右邊
|
// cy.get('#cyTrace').scrollIntoView().should('be.visible'); // 視窗滾到右邊
|
||||||
cy.wait(1000);
|
// cy.wait(1000);
|
||||||
cy.get('.p-chart').scrollIntoView(); // 視窗拉回來
|
// cy.get('.p-chart').scrollIntoView(); // 視窗拉回來
|
||||||
|
|
||||||
|
// // Clear selected item
|
||||||
|
// cy.get('.p-slider-handle:nth-child(2)')
|
||||||
|
// .click()
|
||||||
|
// .trigger('mousedown', { which: 1 })
|
||||||
|
// .trigger('mousemove', { clientX: 250 })
|
||||||
|
// .xpath('//span[contains(@class, "p-slider-handle")][2]')
|
||||||
|
// .click()
|
||||||
|
// .trigger('mouseup');
|
||||||
|
// cy.contains('button', 'Clear').click();
|
||||||
|
// cy.get('.v-toast__text').should('contain', 'Reset Success');
|
||||||
|
// cy.wait(3000);
|
||||||
|
|
||||||
|
// // selected item
|
||||||
|
// cy.get('.p-slider-handle:nth-child(2)')
|
||||||
|
// .click()
|
||||||
|
// .trigger('mousedown', { which: 1 })
|
||||||
|
// .trigger('mousemove', { clientX: 250 })
|
||||||
|
// .xpath('//span[contains(@class, "p-slider-handle")][2]')
|
||||||
|
// .click()
|
||||||
|
// .trigger('mouseup');
|
||||||
|
// cy.contains('button', 'Apply').click();
|
||||||
|
// cy.contains('button', 'Apply').click();
|
||||||
|
// cy.get('#tabFunnel').click();
|
||||||
|
// cy.contains('p', 'Trace');
|
||||||
|
// cy.contains('button', 'Apply All').click();
|
||||||
|
|
||||||
|
// // make sure create map again.
|
||||||
|
// cy.get('header').click();
|
||||||
|
// cy.get('#iconState').click();
|
||||||
|
// cy.get('li').first().then($li => { // then() 獲取 <li> 元素的內容
|
||||||
|
// const percentage = $li.find('span').eq(1).text(); // li 底下找到第二個 span
|
||||||
|
// expect(percentage).not.to.equal('100%'); // text !== 100% 來判斷數據是否有變化
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
it('Timeframes', () => {
|
||||||
|
// select radio
|
||||||
|
cy.get('input#Timeframes3').check({ force: true }); // 選取 Radio 'Trace'
|
||||||
|
cy.wait(3000);
|
||||||
|
|
||||||
// Clear selected item
|
// Clear selected item
|
||||||
cy.get('.p-slider-handle:nth-child(2)')
|
cy.get('.p-slider-handle:nth-child(2)')
|
||||||
|
|||||||
@@ -129,6 +129,17 @@ export default{
|
|||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch:{
|
||||||
|
selectTimeFrame(newValue, oldValue) {
|
||||||
|
console.log(newValue); // []
|
||||||
|
if(newValue.length === 0) {
|
||||||
|
this.startTime = new Date(getMoment(this.filterTimeframe.x_axis.min).format());
|
||||||
|
this.endTime = new Date(getMoment(this.filterTimeframe.x_axis.max).format());
|
||||||
|
this.selectArea = [0, this.selectRange];
|
||||||
|
this.resizeMask(this.chart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resizeMask(chart) {
|
resizeMask(chart) {
|
||||||
let from = (this.selectArea[0] * 0.01) / (this.selectRange * 0.01);
|
let from = (this.selectArea[0] * 0.01) / (this.selectRange * 0.01);
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ export default {
|
|||||||
this.isEndSelected = null;
|
this.isEndSelected = null;
|
||||||
this.isActAllTask = true;
|
this.isActAllTask = true;
|
||||||
// Timeframes
|
// Timeframes
|
||||||
this.timeFrameStartEnd = null;
|
this.selectTimeFrame = [];
|
||||||
// Trace
|
// Trace
|
||||||
if (this.$refs.filterTraceView) {
|
if (this.$refs.filterTraceView) {
|
||||||
this.$refs.filterTraceView.showTraceId = null;
|
this.$refs.filterTraceView.showTraceId = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user