-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathconfigmap-detail-title-bar.spec.ts
More file actions
53 lines (42 loc) · 1.85 KB
/
configmap-detail-title-bar.spec.ts
File metadata and controls
53 lines (42 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { ConfigMapCreateEditPagePo } from '@/cypress/e2e/po/pages/explorer/config-map.po';
const localCluster = 'local';
const namespace = 'default';
const shortName = `a`;
const longName = `e2e-test-long-configmap-name-that-should-truncate-with-ellipsis`;
describe('ConfigMap Detail Title Bar', { testIsolation: false, tags: ['@explorer2', '@adminUser'] }, () => {
before(() => {
cy.login();
cy.createConfigMap(namespace, shortName);
cy.createConfigMap(namespace, longName);
});
it('should keep the state badge adjacent to a short resource name', () => {
const detailPage = new ConfigMapCreateEditPagePo(localCluster, namespace, shortName);
detailPage.goTo();
detailPage.waitForPage();
cy.get('.title-bar h1.title .resource-name').then(($name) => {
cy.get('.title-bar h1.title .badge-state').then(($badge) => {
const nameRect = $name[0].getBoundingClientRect();
const badgeRect = $badge[0].getBoundingClientRect();
const gap = badgeRect.left - nameRect.right;
expect(gap).to.be.lessThan(20);
});
});
});
it('should keep the state badge adjacent to a long resource name', () => {
const detailPage = new ConfigMapCreateEditPagePo(localCluster, namespace, longName);
detailPage.goTo();
detailPage.waitForPage();
cy.get('.title-bar h1.title .resource-name').then(($name) => {
cy.get('.title-bar h1.title .badge-state').then(($badge) => {
const nameRect = $name[0].getBoundingClientRect();
const badgeRect = $badge[0].getBoundingClientRect();
const gap = badgeRect.left - nameRect.right;
expect(gap).to.be.lessThan(20);
});
});
});
after('clean up', () => {
cy.deleteRancherResource('v1', 'configmaps', `${ namespace }/${ shortName }`);
cy.deleteRancherResource('v1', 'configmaps', `${ namespace }/${ longName }`);
});
});