forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 11482-extensions-compatibility-tests
- Loading branch information
Showing
6 changed files
with
118 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Build Dashboard (Release) | |
on: | ||
push: | ||
tags: | ||
- v2.9.* | ||
- v2.* | ||
|
||
jobs: | ||
build-validation: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step | ||
curl -Os https://cli.codecov.io/latest/linux/codecov | ||
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM | ||
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig | ||
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM | ||
|
||
shasum -a 256 -c codecov.SHA256SUM | ||
sudo chmod +x codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
shell/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { mount, Wrapper } from '@vue/test-utils'; | ||
import { clone } from '@shell/utils/object'; | ||
import { _EDIT } from '@shell/config/query-params'; | ||
import { PROV_CLUSTER } from '@shell/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster'; | ||
import RegistryConfigs from '@shell/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue'; | ||
|
||
describe('component: RegistryConfigs', () => { | ||
let wrapper: Wrapper<InstanceType<typeof RegistryConfigs> & { [key: string]: any }>; | ||
|
||
const mountOptions = { | ||
propsData: { | ||
value: {}, | ||
mode: _EDIT, | ||
clusterRegisterBeforeHook: () => {} | ||
}, | ||
stubs: { | ||
SelectOrCreateAuthSecret: true, | ||
SecretSelector: true, | ||
}, | ||
mocks: { $store: { getters: { 'i18n/t': jest.fn() } } } | ||
}; | ||
|
||
describe('key CA Cert Bundle', () => { | ||
it('should display default key', () => { | ||
const value = clone(PROV_CLUSTER); | ||
|
||
value.spec.rkeConfig.registries.configs = { foo: { caBundle: 'Zm9vYmFy' } }; | ||
|
||
mountOptions.propsData.value = value; | ||
|
||
wrapper = mount( | ||
RegistryConfigs, | ||
mountOptions | ||
); | ||
|
||
const registry = wrapper.find('[data-testid^="registry-caBundle"]').element as HTMLTextAreaElement; | ||
|
||
expect(registry.value).toBe('foobar'); | ||
}); | ||
|
||
it('should update key in base64 format', async() => { | ||
const value = clone(PROV_CLUSTER); | ||
|
||
value.spec.rkeConfig.registries.configs = { foo: { caBundle: 'Zm9vYmFy' } }; | ||
|
||
mountOptions.propsData.value = value; | ||
|
||
wrapper = mount( | ||
RegistryConfigs, | ||
mountOptions | ||
); | ||
|
||
const registry = wrapper.find('[data-testid^="registry-caBundle"]'); | ||
|
||
await registry.setValue('ssh key'); | ||
wrapper.vm.update(); | ||
|
||
expect(wrapper.emitted('updateConfigs')![0][0]['foo']['caBundle']).toBe('c3NoIGtleQ=='); | ||
}); | ||
}); | ||
}); |